Access sql with python, please. I'm desperate

been there beginner at
Thu Nov 13 01:52:52 CET 2003

DD <ad at> wrote:
D> Hello,
D> Could anyone please help me??
D> Is there somebody who could explain me how to make a connection to a access
D> database with a python cgi script.
D> I would like to use common sql commands in my python scripts as I can with
D> MySQLdb.
D> But I cannot even connect to the access database (see below).
D> Could anyone explain it to me as simple as possible please. I'm using
D> Windows XP, ActivePython 2.3.2 build 230 and Microsoft access(XP?)
D> I normally use Linux, but this has to be in MS office
>>>> import win32api
>>>> import win32com.client
>>>> engine = win32com.client.Dispatch("DAO.DBEngine.35")
D> Traceback (most recent call last):
D>   File "<interactive input>", line 1, in ?
D>   File "C:\Python23\Lib\site-packages\win32com\client\", line 95,
D> in Dispatch
D>     dispatch, userName =
D> dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
D>   File "C:\Python23\Lib\site-packages\win32com\client\", line 84,
D> in _GetGoodDispatchAndUserName
D>     return (_GetGoodDispatch(IDispatch, clsctx), userName)
D>   File "C:\Python23\Lib\site-packages\win32com\client\", line 72,
D> in _GetGoodDispatch
D>     IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
D> pythoncom.IID_IDispatch)
D> com_error: (-2147221230, 'Klasse is niet gelicenseerd voor gebruik', None,
D> None)
D> thank in advance,
D> Arjen
In windows, you have to go into control panel, administrative tools,
odbc drivers and register the driver you want to use before you can
open a connection to it.  I believe that is your problem.  I am no
expert, just recently had the same issue in making a connection to
a sybase database.

More information about the Python-list mailing list