开发者

QODBC3 Unable to bind to variable

I am attempting to add a new record to a table similar to the example listed below. When I run the query I get the following error: QODBC3: Unable to bind variable. What do I need to do to correct the error?

QSqlQuery query;
query.prepare("INSERT INTO Table (id, val, time) VALUES (:id, :val, :time)");
query.bindValue(":id", 1);
query.bindValue(":val", "23");
开发者_Python百科query.bindValue(":time", QTime(8, 0));
query.exec();


I would guess it doesn't know how to bind the QTime object. Should you be using the toString method?


  1. turned on ODBC tracing
  2. Double check your parameters!
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜