Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
laziness, impatience, and hubris
 
PerlMonks  

RE: Re: ODBC and OLE DB

by KM (Priest)
on May 25, 2000 at 20:39 UTC ( #14804=note: print w/ replies, xml ) Need Help??


in reply to Re: ODBC and OLE DB
in thread ODBC and OLE DB

Well, as I mentioned you are trying to execute the SQL with a method that doesn't exist in Win32::ODBC. Refer to my last response (or the docs for Win32::ODBC) for the correct method. Below is a quick example of using Win32::ODBC:

use Win32::ODBC; my $DSN = qq(DSN Name); my $db; if (!($db = new Win32::ODBC($DSN))){ print "Connection Error: " . Win32::ODBC::Error . "\n"; exit; } my $qry = qq(select * from table); if ($db->Sql($qry)){ print "SQL Error: " . $db->Error . "\n"; $db->Close; exit; } while($db->FetchRow){ my %record = $db->DataHash; print $record{FIELD}; ... etc ... } $db->Close;

Again, read the docs that come with Win32::ODBC, and visit roth.net for more documentation.

Cheers,
KM


Comment on RE: Re: ODBC and OLE DB
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://14804]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (14)
As of 2014-04-23 10:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (541 votes), past polls