a guest Aug 12th, 2016 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- import pyodbc
- dsn = 'sqlserverdatasource'
- user = '<username>'
- password = '<password>'
- database = '<dbname>'
- con_string = 'DSN=%s;UID=%s;PWD=%s;DATABASE=%s;' % (dsn, user, password, database)
- cnxn = pyodbc.connect(con_string)
RAW Paste Data