Hey i checked all the linker paths Include paths every thing is in the right path but still i get the same problem. In debug mode even the database file is created but in release mode after the build is done there is no error exactly but the database file is not created. This is the connection.h code
#ifndef CONNECTION_H
#define CONNECTION_H
#include <QtGui/QMainWindow>
#include <QtSql>
#include <QMessageBox>
#include <QTableView>
inline bool createConnection()
{
db.setDatabaseName(" LPSC");
if (!db.open())
{
QMessageBox::critical(0, qApp
->tr
("Cannot open database"),
qApp->tr("Unable to establish a database connection.\n"
"This example needs SQLite support. Please read "
"the Qt SQL driver documentation for information how "
"to build it.\n\n"
return false;
}
}
#endif
#ifndef CONNECTION_H
#define CONNECTION_H
#include <QtGui/QMainWindow>
#include <QtSql>
#include <QMessageBox>
#include <QTableView>
inline bool createConnection()
{
QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName(" LPSC");
if (!db.open())
{
QMessageBox::critical(0, qApp->tr("Cannot open database"),
qApp->tr("Unable to establish a database connection.\n"
"This example needs SQLite support. Please read "
"the Qt SQL driver documentation for information how "
"to build it.\n\n"
"Click Cancel to exit."), QMessageBox::Cancel);
return false;
}
}
#endif
To copy to clipboard, switch view to plain text mode
I even get this warning when i run it on release mode
warning C4715: 'createConnection' : not all control paths return a value
warning C4715: 'createConnection' : not all control paths return a value
To copy to clipboard, switch view to plain text mode
Pls tell me if i am missing some thing or going any where wrong.
Thank You
Bookmarks