【发布时间】:2014-08-23 20:41:10
【问题描述】:
我正在使用 INSERT 查询,如果我在 VALUES 中传递一个字符串,它可以正常工作,如下所示:
oConn.Execute("Insert into Student_Info(Student_Name) values ('Robin')")
但是如果我以这种方式传递 QLineEdit.text() 会出现错误:
oConn.Execute("Insert into Student_Info(Student_Name) values ('"& (self.StudentName.text()) &"')")
错误:
oConn.Execute("Insert into Student_Info(Student_Name) values ('"& (self.StudentName.text()) &"')")
TypeError: unsupported operand type(s) for &: 'str' and 'QString'
请指教,我不知道出了什么问题。
【问题讨论】:
标签: python python-2.7 ms-access qt4 pyqt4