Qt programming(sqlite)


Hello Linux friend


we are using Qt3.3.4 for my database application,using sqlite on debian platform.we are using libsqlite3:2.1-1 (sqlite lib for debian)and libqt3c102-mt-sqlite3:3.3.34-3(sqlite support lib for qt3).we have included the source code with this mail,when complied it is absolte ok,
when executing it show a error message like "data base file not found or encrypted),we have included the database file with the project.

#include
#include
#include
int main( int argc, char ** argv )
{
QApplication a( argc, argv );
//QApplication::addLibraryPath ( "/home/sujith/driver/sqlite-3.3.8.so" );
QSqlDatabase *db = QSqlDatabase::addDatabase( "QSQLITE" ); //qsqul database driver
db->setDatabaseName("dat.db" );
db->setHostName( "" );
db->setUserName("");
db->setPassword("");
if( !db->open() ){
db->lastError().showMessage( "An error occured. Please read the README file in the sqltable"
"dir for more information.

" );
return 1;
}

else{
db->lastError().showMessage( " ok:");

}
return a.exec();
}

could u find a solution for this

thank u


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories