Open a windows database file with a path name?

Nomad nomad*** at ***freemail.absa.co.za
Wed Nov 14 10:42:46 CET 2001


On Fri, 9 Nov 2001 16:27:15 -0500, "Bill Bell"
<bill-bell at bill-bell.hamilton.on.ca> wrote:

>
>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
Excellent - exactly what I was looking for.  After writing the
origninal post, I realised that as I was using an access database, the
non cross-platform nature of using win32com wouldn't really matter.
However, I haven't even scratched the surface of the win32 extensions,
so thanks for the example to get me started.

If you do remember the URL please post it up here.

Thanks.

PS, what's the "r" for in "( r'ADODB.Recordset' )"?

-- 
Nomad

Wondering of the vast emptyness of the 'net
in search of something cool.



More information about the Python-list mailing list