What steps will reproduce the problem? 1. Configure driver and DSN in odbcinst.ini and odbc.ini 2. Call pypyodbc.connect() with 'DRIVER={driver};...'
What is the expected output? What do you see instead?
I would expect to get a connection back, as it works with isql and pyodbc.
Instead, I get this:
File "db.py", line 141, in db_connection cnxn = pyodbc.connect(cnstring, autocommit=autocommit) File "/home/foo/.virtualenvs/env/lib/python2.6/site-packages/pypyodbc.py", line 1729, in connect return odbc(connectString, autocommit, ansi, timeout, unicode_results, readonly) File "/home/foo/.virtualenvs/env/lib/python2.6/site-packages/pypyodbc.py", line 1544, in init self.connect(connectString, autocommit, ansi, timeout, unicode_results, readonly) File "/home/foo/.virtualenvs/env/lib/python2.6/site-packages/pypyodbc.py", line 1573, in connect validate(ret, SQL_HANDLE_DBC, self.dbc_h) File "/home/foo/.virtualenvs/env/lib/python2.6/site-packages/pypyodbc.py", line 627, in validate ctrl_err(handle_type, handle, ret) File "/home/foo/.virtualenvs/env/lib/python2.6/site-packages/pypyodbc.py", line 612, in ctrl_err raise Error(state,err_text) pypyodbc.Error: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found, and no default driver specified')
What version of the product are you using? On what operating system?
pypyodbc 0.8.6 python 2.6 SuSE Linux Enterprise 11.3
Please provide any additional information below. Doesn't work with system configuration files, user files, or local+ODBCINI+ODBCSYSINI. All of those work with isql and pyodbc.
Comment #1
Posted on Oct 8, 2012 by Swift WombatSame problem with:
pypyodbc trunk python-2.7.3 / pypy-1.9 unixODBC-2.3.1 Gentoo Linux
Comment #2
Posted on Oct 8, 2012 by Helpful Camel(No comment was entered for this change.)
Comment #3
Posted on Jan 14, 2013 by Swift WombatThis should now work fine with the svn head / hg tip revision.
Relevant changeset: https://bitbucket.org/jiangwen365/pypyodbc/commits/23cbcaaea1db6bab505ca7b9b404b893cfb7dd6f
Previously, when using wide Python build with connection string 'DRIVER={driver};...', only the first character (uppercase D) is passed to unixODBC, thus causing the error "Data source name not found, and no default driver specified"
Comment #4
Posted on Jan 14, 2013 by Helpful CamelThanks for the feed back, I'm going to close the ticket.
Comment #5
Posted on Feb 15, 2013 by Helpful CamelHi Felix, can you try the latest 0.9.3 and see if this problem has been fixed?
Comment #6
Posted on Feb 22, 2013 by Helpful Camel(No comment was entered for this change.)
Comment #7
Posted on Mar 23, 2013 by Helpful Camel(No comment was entered for this change.)
Comment #8
Posted on Jul 1, 2014 by Happy BirdI know this bug was closed a while ago, but I am having the exact same problem on Mac OS X with pypyodbc v.1.3.3, python 2.7.5. Is there any chance this was only fixed for Linux, and not Mac?
Status: Fixed
Labels:
Type-Defect
Priority-Medium
OpSys-Linux