[DB-SIG] Trouble with access.

Doug.Shawhan@gecits.ge.com Doug.Shawhan@gecits.ge.com
Tue, 3 Dec 2002 15:55:07 -0500


Hi folks,

I am starting to play with Heinrik Ekelund's new adodbapi module.
Unfortunately I am a little too inexperienced with access to even get to
that pont! :-)

I have never worked with access before, having spent all of my database time
with psycopg/PostGreSQL, gadfly and the berkelydb-type fun included with
python.

I am using python2.2 and Access 2000 (9.0.4402 SR-1)

As you will see below, I can establish a connection to an existing access
database in c:\tmp\ named happy.mdb.

All seems to be fine until it is time to create the cursor. 

--------------------snip------------------------------
import win32com.client
import mx.DateTime as datelibrary
import adodbapi

#prepare the connnection
conn=win32com.client.Dispatch("ADODB.Connection")
#prepare connection information
dbstuff= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\tmp\\happy.mdb;"
#make connection
conn.Open(dbstuff)
#create cursor
c=conn.cursor()

----------------snip-------------------------------

It gives the following error:

Traceback (most recent call last):
  File "access_test.py", line 12, in ?
    c=conn.cursor()
  File "C:\Python22\lib\site-packages\win32com\client\dynamic.py", line 432,
in __getattr__
    raise pythoncom.com_error, details
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0,
'ADODB.Connection', 'Arguments are of the wrong type, are out of acceptable
range, or are in conflict with one another.', 'C:\\WINNT\\HELP\\ADO210.CHM',
0, -2146825287), None)
>Exit code: 1

Can someone either cluebat me with a quick fix to this or point me to a nice
python/access HOWTO? I can't seem to find any floating around.

Thanks!

d