
Originally Posted by
Santosh Reddy
What is creeConnexion()?
It's a function to test the connexion on database
her is the function
static bool creeConnexion()
{
db->setHostName("localhost");
db->setDatabaseName("gestionstockDB.db");
db->setPassword("");
db->setUserName("");
// Verifier l'ouverture de la base de donn�
if(!db->open())
{
return false;
}
return true;
}
static bool creeConnexion()
{
QSqlDatabase *db ;
db = new QSqlDatabase;
*db = QSqlDatabase::addDatabase("QSQLITE") ;
db->setHostName("localhost");
db->setDatabaseName("gestionstockDB.db");
db->setPassword("");
db->setUserName("");
// Verifier l'ouverture de la base de donn�
if(!db->open())
{
return false;
}
return true;
}
To copy to clipboard, switch view to plain text mode
Bookmarks