Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Error: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found, and no default driver specified (0) (SQLDriverConnect)')
- import pyodbc
- def createdatabase():
- driver = 'SQL Server'
- server = '00000000'
- db1 = 'Vodafone'
- tcon = 'yes'
- uname = 'user'
- pword = 'pwd'
- cnxn = pyodbc.connect(driver='{SQL Server}', host=server,database=db1,trusted_connection=tcon, user=uname, password=pword)
- cursor = cnxn.cursor()
- 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