[PyQt] mem error in windows
Mario Daniel Carugno
carugnom at gmail.com
Thu Mar 6 16:18:33 GMT 2008
Hi, i've installed pyqt4 + python2.5 in windows, and wrote a small script to
test ODBC access to
a MySQL table. The script is:
from PyQt4 import QtSql
import sys
db = QtSql.QSqlDatabase.addDatabase("QODBC")
db.setDatabaseName("dnsMySQL")
db.setHostName("localhost")
db.setUserName("myuser")
db.setPassword("mypassw")
if not db.open():
txt = db.lastError().text()
print unicode(txt)
sys.exit()
qry = QtSql.QSqlQuery()
qry.exec_( "select id from mytable where id = 20" )
if qry.next():
a = qry.value(0).toInt()
print a
I run it and executes (it prints the value of a) but then the following
error appears:
the instruction at "0x00ea2acf" referenced memory at "0x01013f20". The
memory could not be "read".
What's the problem ? Any idea ?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20080306/2f48dcb8/attachment.html
More information about the PyQt
mailing list