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. what do i need library when release application with QODBC
Qt 6.11 is out! See what's new in the release blog

what do i need library when release application with QODBC

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

    Win7+Qt5.6+SQL Server 2005

    source:
    db = QSqlDatabase::addDatabase("QODBC");
    db.setDatabaseName(QString("DRIVER={SQL SERVER};"
    "SERVER=%1;"
    "DATABASE=%2;"
    "UID=%3;"
    "PWD=%4;")
    .arg("")
    .arg("
    ")
    .arg("sa")
    .arg("123456"));

    when i debug/release it with Qt Creator, it's ok.

    but when i realse it, and run with Qt's dll, some message on console

    Warning: QT_DEVICE_PIXEL_RATIO is deprecated. Instead use:
    QT_AUTO_SCREEN_SCALE_FACTOR to enable platform plugin controlled per-screen factors.
    QT_SCREEN_SCALE_FACTORS to set per-screen factors.
    QT_SCALE_FACTOR to set the application global scale factor.
    QSqlDatabase: QODBC driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QPSQL QPSQL7
    QSqlQuery::exec: database not open

    1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by
      #2

      Hi, Qt 5.6 didn't have the ODBC plugin file (qsqlodbc.dll) that's probably why the ODBC driver doesn't load for you.
      You could try upgrading to Qt 5.6.1 or Qt 5.7, in those releases qsqlodbc.dll is correctly included.

      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