Access sql with python, please. I'm desperate

Jon Franz jfranz at neurokode.com
Wed Nov 12 20:19:24 EST 2003


Have you tried using the adodbapi module?

It wraps ADO on win32 platforms, and exposes the DBAPI 2.0 spec,
thus you can use the same sort of calls as you did using MySQLdb.

See:
http://adodbapi.sourceforge.net/

If you still want to go the COM route, I'd suggest at least using
ADO and not DAO.

~Jon Franz
NeuroKode Labs, LLC

----- Original Message ----- 
From: "DD" <ad at ad.nl>
To: <python-list at python.org>
Sent: Wednesday, November 12, 2003 6:07 PM
Subject: Access sql with python, please. I'm desperate


> Hello,
>
> Could anyone please help me??
> Is there somebody who could explain me how to make a connection to a
access
> database with a python cgi script.
> I would like to use common sql commands in my python scripts as I can with
> MySQLdb.
> But I cannot even connect to the access database (see below).
> Could anyone explain it to me as simple as possible please. I'm using
> Windows XP, ActivePython 2.3.2 build 230 and Microsoft access(XP?)
> I normally use Linux, but this has to be in MS office
>
> >>> import win32api
> >>> import win32com.client
> >>> engine = win32com.client.Dispatch("DAO.DBEngine.35")
> Traceback (most recent call last):
>   File "<interactive input>", line 1, in ?
>   File "C:\Python23\Lib\site-packages\win32com\client\__init__.py", line
95,
> in Dispatch
>     dispatch, userName =
> dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
>   File "C:\Python23\Lib\site-packages\win32com\client\dynamic.py", line
84,
> in _GetGoodDispatchAndUserName
>     return (_GetGoodDispatch(IDispatch, clsctx), userName)
>   File "C:\Python23\Lib\site-packages\win32com\client\dynamic.py", line
72,
> in _GetGoodDispatch
>     IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
> pythoncom.IID_IDispatch)
> com_error: (-2147221230, 'Klasse is niet gelicenseerd voor gebruik', None,
> None)
>
> thank in advance,
>
> Arjen
>
>
>
>






More information about the Python-list mailing list