Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Answer: What is the difference between ADO and ODBC ?

( #117713=categorized answer: print w/ replies, xml ) Need Help??

Q&A > database programming > What is the difference between ADO and ODBC ? contributed by jehuni

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);

-jehuni

Comment on Answer: What is the difference between ADO and ODBC ?
Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2014-08-23 01:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (170 votes), past polls