Open a windows database file with a path name?

Nomad nomad*** at ***
Wed Nov 14 10:43:32 CET 2001

On 10 Nov 2001 01:59:22 -0800, osuchw at (waldekO) wrote:

>Nomad <nomad***@***> wrote in message news:<qnonuto5ao5iu4c0fa1ttletlje3s9sfck at>...
>> Hi,
>> Is there anyway that I can open a database (MSAccess in this case)
>> using the path and file name rather than a DSN?  I can't seem to get
>> it to work.
>> TIA
>try this:
>>>> from win32com.client import Dispatch, constants
>>>> eng = Dispatch('DAO.DBEngine.36')
>>>> db = eng.OpenDatabase('c:/db1.mdb')
>>>> rs = db.OpenRecordset('select * from tblHolidays')
>>>> rs.Fields('ID').Value
>>>> rs.MoveNext()
>>>> rs.Fields('ID').Value

Cheers, That's pretty much what I was looking for, but I think I'll go
for the ADO version sent by Bill Bell.

Thanks anyway.


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

More information about the Python-list mailing list