I am using ActivePython 2.7.2.5 on Windows 7.
When I try to connect to the sql server database with the pyobbc module using the code below, I get the following Traceback. Any ideas on what I'm doing wrong?
CODE:
import pyodbc driver = 'SQL Server' server = '**server-name**' db1 = 'CorpApps' tcon = 'yes' uname = 'jnichol3' pword = '**my-password**' cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=server;DATABASE=db1;UID=uname;PWD=pword;Trusted_Connection=yes') cursor = cnxn.cursor() cursor.execute("select * from appaudit_q32013") rows = cursor.fetchall() for row in rows: print row
trace of TRACEBACK calls:
Traceback (most recent call last): File "pyodbc_test.py", line 9, in <module> cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=server;DATABASE=db1;UID=uname;PWD=pword;Trusted_Connection=yes') pyodbc.Error: ('08001', '[08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. (17) (SQLDriverConnect); [01000] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()). (53)')
source share