[python-win32] Unable to connect to MSSQL Database(x64) using pyodbc 32bit & python 32bit

siddhartha veedaluru siddhartha.veedaluru at gmail.com
Fri Feb 6 17:58:28 CET 2009


Hi all,

I trying to connect to MSSQl 2005 Database which is on a x64 bit machine.
i have installed 32bit python2.5 and pyodbc.pywin32-211
i have created a odbc DSN.
When i'm using this DSN in the script it errors out saying
('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not
found and no default driver specified (0)')

 Here is my script
import pyodbc,sys,os
conString = "DSN=int2003r2-64bit;UID=sa;PWD=kbuilder"
try:
       con = pyodbc.connect(conString)
except pyodbc.Error, erno:
        mesg = "Error:Unable to establish connection to Database"
         print mesg
         print erno
         sys.exit(1)
cur = con.cursor()
query = "select id from CLIENT where name = 'int2003r2-64bit'"
try:
      cur.execute(query)
except pyodbc.Error, erno:
      mesg = "Unable to execute %s query" % query
      print mesg
     sys.exit(1)
for row in cur:
 clientId = row[0]

Please Help.
Thanks
Sid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20090206/c65d0b20/attachment.htm>


More information about the python-win32 mailing list