Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. QtSqlite driver not loaded error.
Forum Updated to NodeBB v4.3 + New Features

QtSqlite driver not loaded error.

Scheduled Pinned Locked Moved Installation and Deployment
10 Posts 5 Posters 18.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    culum
    wrote on last edited by
    #1

    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]

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • C Offline
        C Offline
        culum
        wrote on last edited by
        #3

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

        }

        @

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • C Offline
            C Offline
            culum
            wrote on last edited by
            #5

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

            and tryed windows xp not work.

            1 Reply Last reply
            0
            • C Offline
              C Offline
              cincirin
              wrote on last edited by
              #6

              @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.

              1 Reply Last reply
              0
              • C Offline
                C Offline
                culum
                wrote on last edited by
                #7

                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"
                @

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goetz
                  wrote on last edited by
                  #8

                  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)).

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  1 Reply Last reply
                  0
                  • Z Offline
                    Z Offline
                    zither
                    wrote on last edited by
                    #9

                    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.

                    1 Reply Last reply
                    0
                    • C Offline
                      C Offline
                      culum
                      wrote on last edited by
                      #10

                      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 :)

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved