Hi,
I am facing some problems while accessing the Microsoft Access Database
2007, using win32com. The code and errors are given below. 
I also tried the steps in the link but to no avail:

http://www.microsoft.com/en-us/download/confirmation.aspx?id=23734

Could you help, or also if you know of a any other way of accessing the
database using the win32com module.

Version: 
ActivePython 2.7.2.5 (ActiveState Software Inc.) based on
Python 2.7.2 (default, Jun 24 2011, 12:22:14) [MSC v.1500 64 bit
(AMD64)] on win32

Operating System: Windows 7

Code:
try:
    import sys
    from win32com.client import Dispatch
except ImportError as e:
    print e
    sys.exit(1)

if __name__ == '__main__':
    data_source = "C:\\temp\\Database1.accdb"
    access = Dispatch('ADODB.Connection')
    access.Open('PROVIDER=Microsoft.ACE.OLEDB.12.0;Driver={Microsoft
Access Driver (*.mdb, *.accdb)};DBQ=C:\\temp\\Database1.accdb;')


Error:

C:\> a_db.py
Traceback (most recent call last):
File "D:\Data\Python Scripts\For the heck of sharepoint\a_db.py", line
11, in <module>
access.Open('PROVIDER=Microsoft.ACE.OLEDB.12.0;Driver={Microsoft Access
Driver (*.mdb, *.accdb)}
;DBQ=C:\\temp\\Database1.accdb;')
File "<COMObject ADODB.Connection>", line 3, in Open
File "C:\ActivePython27\lib\site-packages\win32com\client\dynamic.py",
line 276, in _ApplyTypes_
result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType,
argTypes) + args)
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0,
u'ADODB.Connection', u'Provider canno
t be found. It may not be properly installed.',
u'C:\\Windows\\HELP\\ADO270.CHM', 1240655, -21468245
82), None)
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to