Solved How to solve the error of "connection 'MSSQL' is still in use, all queries will cease to work"?
QSqlDatabasePrivate::removeDatabase: connection 'MSSQL' is still in use, all queries will cease to work.
QSqlDatabasePrivate::addDatabase: duplicate connection name 'MSSQL', old connection removed.
- Please change the title to something more comprehensive and do not continue to post simpy error messages.
- Give a couple of details what you are actually trying to achieve.
- Possibly a short section of code may help to give others an understanding of your goal.
dheerendra Qt Champions 2022 last edited by
In addition to @koahnig said, looks like you are trying to open the DB connection from two places in your code. Hence getting into this issue.
How to fix the errors please explain me.......
If you show us the code where it goes wrong, then we could help you.
yes you are right .....i have fixed this error. i have opened the connection twice.....thanks @dheerendra ....
dheerendra Qt Champions 2022 last edited by dheerendra
@veera "How to fix the errors please explain me......."
please note that people in this forum are giving you the solution based on the problem statement you explain. Based on your error message I suggested possible condition. Without you sharing the code no body can help you to fix the problem. Your response to my suggestion looked harsh to me. Be polite & people are helping here based on their interest.
I am really sorry for that....i am opening database connection in qt application as well as trying to open in QtRPT reporting tool also ... i have commented in database connection code in QtRPT tool....it works for me ...... I was making a report using QtRPT tool........
@veera said in How to solve the error of "connection 'MSSQL' is still in use, all queries will cease to work"?:
Almost any answer within this forum may be crytal ball reading to your problems. As also @dheerendra iterated and others including myself have asked for some code samples showing were your problem is. QtRPT is not Qt and simply using Qt libraries as many other software and tools. You might be lucky and there is a user of QtRPT in this forum, but your chances are much better to address your questions in the QtRPT forum.
yes it is a reporting design tool.....