mxODBC puzzle

Bill Witherspoon bwitherspoon at emseal.com
Tue Apr 29 21:59:07 CEST 2003


I've been fooling around with mxODBC/mxDateTime for a couple of days 
now, trying to effect an Update query. Can anyone spot the error I'm 
making with the code below:


sql = "Update tblOEOrders set tblOEOrders.ScheduleDate = #" + 
newdate.strftime("%m/%d/%Y") + "# where tblOEOrders.OrderID = " + 
str(orderid) + ";"

myconn = mx.ODBC.Windows.Connect('production')
mycursor = myconn.cursor()
numlines_affected = mycursor.execute(qrystring)

The DB is Access97 via DSN (which is *not* read only), and query seems 
to return OK (1 record affected), but the record never gets updated. 
Using the same code I can do Selects without difficulty.
Do I have to do a fetchall() equivalent to make the update query run, or 
is something else wrong?

TIA,
Bill.






More information about the Python-list mailing list