I have the following method:
def open(self, filename):
if not os.path.exists(filename):
raise IOError("Cannot find Game Database file {0}").__format__(filename)
connstr = "Provider=Microsoft.SQLSERVER.CE.OLEDB.4.0;
Data Source={0};".format(filename)
conn = adodbapi.connect(connstr)
curs = conn.cursor()
query = "Select * from Patient;"
curs.execute(query)
results = curs.fetchall()
for r in results:
print r
When this runs, the following error is rased on curs.execute(query):
(<class 'adodbapi.adodbapi.DatabaseError'>, u"(-2147352567, 'Exception occurred.', (0, u'Microsoft Cursor Engine', u'Multiple-step operation generated errors. Check each status value.', None, 0, -2147217887), None)
Command:
Select * from Patient;
Parameters:
[]")
I can run this exact query in compactView successfully.
What obvious syntactic sugar am i not seeing? ( running: win7 pro x64, python 2.7.x, pywin32 and adodbapi installed successfully. The connection string seems to work -- i can connect and get a cursor just fine)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…