Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QSqlError("", "Driver not loaded", "Driver not loaded")

QSqlError("", "Driver not loaded", "Driver not loaded")

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 170 Views
  • 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.
  • Y Offline
    Y Offline
    yato
    wrote on last edited by yato
    #1

    alguém poderia me ajudar com esse problema?
    sempre recebo essa mensagem no output

    QSqlDatabase: QPSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMIMER QODBC QPSQL
    aberto? false false QSqlError("", "Driver not loaded", "Driver not loaded")
    QSqlQuery::prepare: database not open
    Erro ao executar a consulta SQL: "Driver not loaded Driver not loaded"

    sou novo no Qt e estou com o seguinte erro, estou utilizando o windows 11

    meu código seria esse aqui:

    void conectar(QSqlDatabase db) {

        db = QSqlDatabase::addDatabase( "QPSQL" );
        db.setHostName( "localhost" );
        db.setDatabaseName( "postgres" );
        db.setUserName( "postgres" );
        db.setPassword( "12345" );
        db.setPort( 5432 );
    
        bool ok = db.open();
        qDebug() << "aberto?" << ok << db.isOpenError() << db.lastError();
    
    }
    
    C 1 Reply Last reply
    0
    • Y yato

      alguém poderia me ajudar com esse problema?
      sempre recebo essa mensagem no output

      QSqlDatabase: QPSQL driver not loaded
      QSqlDatabase: available drivers: QSQLITE QMIMER QODBC QPSQL
      aberto? false false QSqlError("", "Driver not loaded", "Driver not loaded")
      QSqlQuery::prepare: database not open
      Erro ao executar a consulta SQL: "Driver not loaded Driver not loaded"

      sou novo no Qt e estou com o seguinte erro, estou utilizando o windows 11

      meu código seria esse aqui:

      void conectar(QSqlDatabase db) {

          db = QSqlDatabase::addDatabase( "QPSQL" );
          db.setHostName( "localhost" );
          db.setDatabaseName( "postgres" );
          db.setUserName( "postgres" );
          db.setPassword( "12345" );
          db.setPort( 5432 );
      
          bool ok = db.open();
          qDebug() << "aberto?" << ok << db.isOpenError() << db.lastError();
      
      }
      
      C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      @yato said in QSqlError("", "Driver not loaded", "Driver not loaded"):

      alguém poderia me ajudar com esse problema?
      sempre recebo essa mensagem no output

      The Qt PostgreSQL plugin is present but cannot load. This is probably because the PostgreSQL runtime libraries (DLLs) are not installed, or not in the same location as your program executable or on the system PATH.

      1 Reply Last reply
      1

      • Login

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