Open a windows database file with a path name?

Bill Bell bill-bell at bill-bell.hamilton.on.ca
Fri Nov 9 16:27:15 EST 2001


Nomad <nomad***@***freemail.absa.co.za> wrote, in part:
> Is there anyway that I can open a database (MSAccess in this case)
> using the path and file name rather than a DSN?

It goes something like this:

conn = win32com.client.Dispatch ( r'ADODB.Connection' )
connString = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA 
SOURCE=<path>;'
conn.Open ( connString )
rs = win32com.client.Dispatch ( r'ADODB.Recordset' )
rs.Open ( SQL, conn, 1, 3 )

There's a good web page offering clues about working with ADODB 
and Python. (If I could remember where it is I'd even tell you!)

Bill
"It is the time that you have wasted for your rose that makes your rose so important."--St-Exupery




More information about the Python-list mailing list