CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Win32 Programming Help:
Help with Win32::ODBC


New User

Dec 11, 2007, 3:13 PM

Post #1 of 3 (6482 views)
Help with Win32::ODBC Can't Post

Greetings all,

This is my very first perl script and I'm having a little trouble with using the Win32::ODBC module. I think the module is installed correctly. I ran the script that came in the download and the odbc connection I want to use is listed there. I've played around w/ my code quite a bit and it always results in diffrent errors (although they seem to be the same rootcause). Here are some sample script and errors:

use Win32::ODBC;
$db = new Win32::ODBC("casql100");
$db->Sql("SELECT * FROM Blah);

Can't call method "Close" on an undefined value
Can't call method "Sql" without a package or object reference

Any help or guidence is appreciated. Thanks.


Dec 11, 2007, 6:14 PM

Post #2 of 3 (6481 views)
Re: [fancy_pants] Help with Win32::ODBC [In reply to] Can't Post

Error checking should help reveal the problem:-

use Win32::ODBC; 

$db = new Win32::ODBC("casql100")
or die Win32::ODBC::Error(), "\n";


New User

Dec 12, 2007, 8:56 AM

Post #3 of 3 (6477 views)
Re: [Kanji] Help with Win32::ODBC [In reply to] Can't Post

Yes sir, I acutally figured that part out late yesterday and found that it was sending a null username and password. I changed "$db = new Win32::ODBC("casql100")" part to include that info and it connects fine now.

I guess my follow up question is why isn't it using the L/P that I have specified in the ODBC connection?


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives