Skip to content

Instantly share code, notes, and snippets.

@danielhmills
Created February 25, 2021 02:42
Show Gist options
  • Save danielhmills/c5c1d4679a83d7de50dfe8cea8f3b04f to your computer and use it in GitHub Desktop.
Save danielhmills/c5c1d4679a83d7de50dfe8cea8f3b04f to your computer and use it in GitHub Desktop.
import pyodbc as db
q = "SELECT * FROM demo..company"
cnxn = db.connect("DSN=Demo DB;UID=vdb;PWD=vdb")
cursor=cnxn.cursor()
cursor.execute(q)
row=cursor.fetchall()
if row:
print(row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment