Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: What is the difference between ADO and ODBC ?

by jehuni (Pilgrim)
on Oct 09, 2001 at 16:43 UTC ( #117713=note: print w/replies, xml ) Need Help??

in reply to What is the difference between ADO and ODBC ?

ADO is basically a high-level OO interface to various low-level OLEDB data providers. ODBC is another kind of low-level data provider, and if there is no native OLEDB provider for the type of database you use, but there is an ODBC one, you can always use the OLEDB provider for ODBC to bridge that gap.

IMHO, ADO is a much more flexible option than dealing directly with a data provider like ODBC, unless you really have the need to some sort of low-level optimization. Plus, for an MS database technology like Access, using a native OLEDB provider should be faster.

Since you can't set up a DSN, I believe that something like this will work for you:

use strict; use Win32::OLE; my $provider = 'Microsoft.Jet.OLEDB.4.0'; my $dir = 'c:\perl\cgi-bin'; my $dbase = 'mydb.mdb'; my $user = ''; #use if needed my $password = ''; #use if needed my $connStr = "Provider=$provider;Data Source=$dir\\$dbase;User ID=$us +er;Password=$password;"; my $conn = Win32::OLE->new('ADODB.Connection') or die("Could not creat +e Connection: $!"); $conn->Open($connStr);


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2021-06-14 09:02 GMT
Find Nodes?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)

    Results (62 votes). Check out past polls.