Hi...I am building a qt(4.5.3) application which uses sqlite database. My sample code is
QSqlDatabase db;
db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName("sample.db");
db.open();
Here db.open() function opens my database, creates new databas(sample) if didnt existed.
Any how it returning db handle. But my issue is, if i am creating database first time i need to create some tables. If database already existed then need to read those tables. If i am using db.open() function it returning a valid db handle but how can i know that my database is created just now are it has been created before. please give me a solution.( i am new to qt)
Bookmarks