Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 cooling their heels in the Monastery: (9)
As of 2015-07-03 17:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (54 votes), past polls