M
M
Mahin2018-03-01 15:06:24
MySQL
Mahin, 2018-03-01 15:06:24

Qt+MySql. Why is exec not processed after prepare?

I'm trying to repeat the lesson with connecting to the database. Always used QSqlQuery::exec and it worked. In the example, before executing the query, pass the query string to QSqlQuery::prepare:

qry->prepare("SELECT position from pos;");
qry->exec();

when passing the received request to the model, I get empty lines.
If I do this: everything is displayed normally. Where to dig?
qry->exec("SELECT position from pos;");

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question