我正试图执行以下文字,但我没有获得预期结果,也没有错误信息。
import pyodbc
cnxn = pyodbc.connect("Driver={SQL Server Native Client 11.0};"
"Server=mySRVERNAME;"
"Database=MYDB;"
"uid=sa;pwd=MYPWD;"
"Trusted_Connection=yes;")
cursor = cnxn.cursor()
cursor.execute( select DISTINCT firstname,lastname,coalesce(middlename, ) as middlename from Person.Person )
for row in cursor:
print( row = %r % (row,))
我如何能够从AQ服务器数据库获得数据?