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-Release

    Not 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]



  • the qsqlite*4.dll files do not belong where you put them. They should be in a folder called sqldrivers.



  • 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;
    }
    

    }

    @



  • Read my post again, and then try again...
    Also: use forward slashes in file paths in code, even on windows or symbian.



  • Thanks, I tryed Windows 7 64 bit it's works.

    and tryed windows xp not work.



  • @culum, you are using mixed debug & release versions of "Qt redistributable libraries". Note that in "sqldrivers" directory you put qsqlited4.dll instead of qsqlite4.dll.



  • 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 +=sql

    TARGET = MusteriTakip
    TEMPLATE = app

    SOURCES += main.cpp
    anaekran.cpp
    dialog.cpp

    HEADERS += anaekran.h
    dialog.h

    FORMS += anaekran.ui
    dialog.ui

    RESOURCES +=
    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 :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.