python - How to connect to MS Access 97 (with workgroup mdw) database using pyodbc -
in python script pyodbc, trying connect still used access 97 database on our network have problems connection (or connection string) work.
i keep getting following error:
pyodbc.error: ('im002', '[im002] [microsoft][odbc driver manager] data source name not found , no default driver specified (0) (sqldriverconnectw)') this connection string fails above mentioned error:
conn = pyodbc.connect('driver={microsoft access driver (.mdb)};provider=microsoft.jet.oledb.4.0;password=mypassword;user id=myusername;dbq=\\fileserver\\conta\\locationdir\\mydatabase_be.mdb;persist security info=true;jet oledb:system database=\\fileserver\\backend\\mdw\\system.mdw') as can see, connection requires use system database (workgroup - mdw). database on network-storage.
i using python 2.7.
can help?
edit: in connection-string, backslashes should double backslashes. seems single backslash shown.
ok, got sorted. solution based on following snippet (was matter of getting syntax right):
strconnection = (r"driver={microsoft access driver (*.mdb)};" r"dbq=c:\\vc projects\\ado\\samples\\adotest\\dbtestsecurity.mdb;" r"systemdb=c:\\program files\\microsoft office\\office\\system.mdw;" r"uid=carlos antollini;pwd=carlos") conn = pyodbc.connect(strconnection) #your code solution found in web-page
hope may useful else.
Comments
Post a Comment