I need to send Unicode to SQL Server using Python 2.7. I failed with pymssql . Now I'm trying to get pypyodbc to work (unlike pyodbc ), as it gives working Unicode examples . The problem is that the connection string in the example is not like anything I recognize. I looked over this one , and after a little trial and error I built this line:
conn = pypyodbc.connect("DRIVER={SQL Server};SERVER='MyServer';UID='me';PWD='MyPassword';DATABASE='db'")
Return a DatabaseError focused on the connection string:
C:\Anaconda\lib\site-packages\pypyodbc.pyc in __init__(self, connectString, autocommit, ansi, timeout, unicode_results, readonly, **kargs) ---> 2 conn = pypyodbc.connect("DRIVER={SQL Server};SERVER='MyServer';UID='me';PWD='password';DATABASE='db'") C:\Anaconda\lib\site-packages\pypyodbc.pyc in __init__(self, connectString, autocommit, ansi, timeout, unicode_results, readonly, **kargs) ---> 2273 self.connect(connectString, autocommit, ansi, timeout, unicode_results, readonly) C:\Anaconda\lib\site-packages\pypyodbc.pyc in connect(self, connectString, autocommit, ansi, timeout, unicode_results, readonly) ---> 2321 check_success(self, ret) C:\Anaconda\lib\site-packages\pypyodbc.pyc in ctrl_err(ht, h, val_ret, ansi) ---> 919 raise DatabaseError(state,err_text) DatabaseError: (u'08001', u'[08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.')
I know that my credentials are correct because I used them to successfully connect using pymssql. What am I missing?
bahmait
source share