PDA

View Full Version : error while opening the database from Qt



kulsekarr
22nd October 2013, 17:29
Hi,
I am trying to open a database and create a table using SQL server 2008, everything is working fine,
when the application is executed for first time and if I re-run the application once again the same database it is throwing some runtime errors, how to check whether if that database is already opened wit the same name

I have attached my code please do suggest something.s

toufic.dbouk
22nd October 2013, 18:10
What are the thrown errors ?
Normally QSqlDatabase::isOpen() can be used to check if the databse connection is currently open.
Dont forget to close the connection of course using QSqlDatabase::close().
You need to be more specific when you seek help.

Good Luck.

kulsekarr
23rd October 2013, 18:17
Thankyou toufic for your reply.. finally got it..