jangbagu / pypyodbc

Automatically exported from code.google.com/p/pypyodbc
0 stars 0 forks source link

Unable to connect mdb files py2.7 win64 #67

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. When i try to connect to an unspaced path the code works fine, but it 
doesn´t when the path is spaced

What is the expected output? What do you see instead?

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build\bdist.win-amd64\egg\pypyodbc.py", line 2434, in __init__
  File "build\bdist.win-amd64\egg\pypyodbc.py", line 2483, in connect
  File "build\bdist.win-amd64\egg\pypyodbc.py", line 988, in check_success
  File "build\bdist.win-amd64\egg\pypyodbc.py", line 964, in ctrl_err
pypyodbc.Error: (u'HY000', u"[HY000] [Microsoft][ODBC Microsoft Access 
Driver]General error Unable to open registry key Temporary (volatile) Ace DSN 
for process 0x15b4 Thread 0x5a8 DBC 0x4737f98                                   
                           Jet'.")

What version of the product are you using? On what operating system?

Python 2.7.9 (default, Dec 10 2014, 12:28:03) [MSC v.1500 64 bit (AMD64)] on 
win32

Please provide any additional information below.

This is the code before...

>>> connection_string = "Driver={Microsoft Access Driver (*.mdb, 
*.accdb)};DBQ=C:\\ARCHIVOS DE TRABAJO\\EVALUACION DE FUENTES DE 
ABASTECIMIENTO\\ANALISIS DE DEMANDA-ABASTECIMIENTO\\29082005.mdb"
>>> con = pypyodbc.connect(connection_string)

Original issue reported on code.google.com by ing.carl...@gmail.com on 5 May 2015 at 11:15

GoogleCodeExporter commented 8 years ago
After a while of looking for how can fix this i think i got it...

On Windows 8.1 64-bits, Python 64-bits, MS Office 32-bits

1. Install AccessDatabaseEngine (because MS Office 32 bits)
https://www.microsoft.com/en-us/download/details.aspx?id=13255

2. Verify this: Control Panel/Administrative Tools ->
right click on ODBC Data Sources (32-bits) in Target:
%windir%\syswow64\odbcad32.exe
right click on ODBC Data Sources (64-bits) in Target:
%windir%\system32\odbcad32.exe

3. Uninstall Python 64-bits and install Python 32-bits and pypyodbc module

Done, hope this help somebody else...

Original comment by ing.carl...@gmail.com on 7 May 2015 at 9:48