开发者

QODBC3 Unable to bind to variable

开发者 https://www.devze.com 2023-02-11 02:24 出处:网络
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

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

精彩评论

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