Siddhartha: This seems to be a pyodbc question, and would be best answered on their discussion group. Try http://groups.google.com/group/pyodbc
The SQL dbapi interfaces which ship with pywin32 are odbc and adodbapi. Nevertheless, your very long DSN string gives me pause. You might try going back in to your Control Panel->Administrative Tools->Data Sources (ODBC) and define a simpler DSN. The one I use most often is "Test". Make sure the administration tool can access your database by using its built in "test" button. -- Vernon On Fri, Feb 6, 2009 at 9:58 AM, siddhartha veedaluru < siddhartha.veedal...@gmail.com> wrote: > 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 > > > _______________________________________________ > python-win32 mailing list > python-win32@python.org > http://mail.python.org/mailman/listinfo/python-win32 > >
_______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32