Advertisement
Guest User

Untitled

a guest
Jan 9th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. Error: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found, and no default driver specified (0) (SQLDriverConnect)')
  2.  
  3. import pyodbc
  4.  
  5. def createdatabase():
  6. driver = 'SQL Server'
  7. server = '00000000'
  8. db1 = 'Vodafone'
  9. tcon = 'yes'
  10. uname = 'user'
  11. pword = 'pwd'
  12.  
  13. cnxn = pyodbc.connect(driver='{SQL Server}', host=server,database=db1,trusted_connection=tcon, user=uname, password=pword)
  14. cursor = cnxn.cursor()
  15.  
  16. DRIVER={FreeTDS};SERVER=yoursqlserver.com;PORT=1433;DATABASE=yourdb;UID=youruser;PWD=yourpass;TDS_Version=7.2;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement