QtSqlite driver not loaded error.
-
I tryed this solutions;
http://www.qtcentre.org/threads/12498-SQlite-driver-not-loaded-error
http://www.qtcentre.org/threads/32585-QT-amp-SQLite-driver-not-loaded
http://www.qtcentre.org/threads/30915-Sqlite-driver-not-loading
http://www.qtcentre.org/threads/16129-SQL-Driver-not-loaded-in-ReleaseNot work.
My applicaton path:
libgcc_s_dw2-1.dll
mingwm10.dll
qsqlite4.dll
qtcore4.dll
qtgui4.dll
qtsql4.dll
qsqlited4.dll
Myapplication[moved to the installation subforum, Eddy]
-
Okay. I tryed;
@ libgcc_s_dw2-1.dll
mingwm10.dll
qsqlite4.dll
qtcore4.dll
qtgui4.dll
qtsql4.dll
qsqlited4.dll
Myapplication@and
@sqldrivers/
qtsql4.dll
qsqlited4.dll@Didn't work.
Note I used this code;
@
QSqlDatabase veritabani = QSqlDatabase::addDatabase("QSQLITE");bool AnaEkran::baglan()
{
ui->label_6->setVisible(false);veritabani.setHostName("localhost"); veritabani.setDatabaseName("c:\\veritabani.db"); durumayarla(20, "Veritabani açılıyor...", false, true); if(!veritabani.open()) { QMessageBox::critical(0, QObject::tr("Veritabanı hatası"), veritabani.lastError().text()); return false; durumayarla(50, "Veritabanı açılamadı...", false, false); } else { return true; }
}
@
-
cincirin didn't work.
I downloaded "Sqlite man" it's on windows xp work.
I own schedule, "Sqlite man" directory, and copied, but I get an error.
Do not understand where the error...
Thanks for reply..
Note:My english very badly.
My pro file;
@QT += core gui
QT +=sqlTARGET = MusteriTakip
TEMPLATE = appSOURCES += main.cpp
anaekran.cpp
dialog.cppHEADERS += anaekran.h
dialog.hFORMS += anaekran.ui
dialog.uiRESOURCES +=
kaynak.qrc@
My headers;
@
#include "anaekran.h"
#include "ui_anaekran.h"
#include "QMessageBox"
#include "QtSql"
#include "QSqlQuery"
#include "QDebug"
#include "QSqlDriver"
#include "QMovie"
#include "QTableWidget"
#include "dialog.h"
@ -
qtsql4.dll (the SQL module) belongs in the main directory, only qtsqlite.dll (the SQLite driver) belongs in sqldrivers.
Also, as stated by cincirin, you must not mix debug and release DLLs (you did! watch for the difference in qtsqlite.dll (release) and qtsqlited.dll (debug)).
-
Only qtsqlite4.dll should be placed sqldrivers folder. Not include qtsql4.dll. Like that
@libgcc_s_dw2-1.dll
mingwm10.dll
qtcore4.dll
qtgui4.dll
qtsql4.dll
Myapplication
sqldrivers/qtsqlite4.dll@If u try to use exe compressor like UPX, don't use qtsqlite4.dll. That'll cause error.
-
I finded problem.
It's not driver problem.
Problem:
@QSqlDatabase veritabani = QSqlDatabase::addDatabase("QSQLITE");bool AnaEkran::baglan()
{
ui->label_6->setVisible(false);
veritabani.setHostName("localhost"); veritabani.setDatabaseName("c:\\veritabani.db"); durumayarla(20, "Veritabani açılıyor...", false, true); if(!veritabani.open()) { QMessageBox::critical(0, QObject::tr("Veritabanı hatası"), veritabani.lastError().text()); return false; durumayarla(50, "Veritabanı açılamadı...", false, false); } else { return true; }
}@
My solution; create new database class;
@#include "veritabani.h"
#include "QSqlDatabase"
#include "QMessageBox"
#include "QSqlError"
veritabani::veritabani(QObject *parent) :
QObject(parent)
{}
bool veritabani::baglantiyap()
{
vt = QSqlDatabase::addDatabase("QSQLITE");
vt.setDatabaseName("veritabani.db");
if (!vt.open()) {
QMessageBox::critical(0, QObject::tr("Veritabanı hatası"),
vt.lastError().text());
return false;
}
return true;
}
@@
#include "anaekran.h"
#include "ui_anaekran.h"
#include "veritabani.h"
#include "QMessageBox"
#include "QSqlQuery"
#include "QSqlTableModel"
#include "musteriekle.h"
#include "musteriduzenle.h"
veritabani test;
QSqlTableModel *model;
AnaEkran::AnaEkran(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::AnaEkran)
{
ui->setupUi(this);
if(test.baglantiyap())
{...
@It works. Not problem, thank you for reply :)