pyodbc.Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnectW)')

3,046 views
Skip to first unread message

torsten...@yahoo.es

unread,
May 11, 2011, 5:50:07 AM5/11/11
to pyodbc
Hi,

I am trying to use odbc 2.1.8 with python 2.6 on Windows XP. I am
simply trying to connect to the database:

cnxn = pyodbc.connect('DRIVER = {SQL Server}; SERVER = xxx.xx.xxx.xxx;
DATABASE = data_base; UID = my_uid; PWD = my_pwd')

And I am getting the following error:

pyodbc.Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data
source name not found and no default driver specified (0)
(SQLDriverConnectW)')

I am new to ODBC and not really an SQL specialist neither, i.e. I
might be missing something fairly simple... but haven't found the
solution.

Thanks for the help!

Michael Kleehammer

unread,
Jul 28, 2011, 10:30:47 PM7/28/11
to pyo...@googlegroups.com
Are you sure a SQL Server driver is actually installed?  I'm not sure it was on XP.  Find the Data Sources (ODBC) panel in the administrative tools and check the Drivers tab.

If not, a Google search should lead you to the appropriate Microsoft installer.  (Don't download from somewhere else.)  You might need to look for MDAC.

Reply all
Reply to author
Forward
0 new messages