Solved getting already open database connection
-
@Christian-Ehrlicher
the error is fromQSqlQuery::lastError()
.
and it worked with default connection -
Please show the query, make sure that the db is really open at the time you're trying to execute the query.
-
Hi,
To add to @Christian-Ehrlicher, I am not sure that using a file path is necessarily a good idea for a connection name.
-
@SGaist
then what should i be using? -
A meaningful identifier, just the name of the database, etc. That's up to you.
-
@SGaist
yeah something unique, so i thought file path would be more unique then fine name -
In any case, you should do as @Christian-Ehrlicher wrote: get the error from the failed query.
-
@SGaist
the parameter mismatch error is the text given bylastError()
-
And what is the query ? The one returned by lastQuery ?
-
actually
prepare()
was failing and i got the error from sql query at right after prepare() and it was meaningful