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. Problems with QSqlDatabase::setConnectOptions

Problems with QSqlDatabase::setConnectOptions

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 1.5k 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.
  • A Offline
    A Offline
    Alurab
    wrote on last edited by
    #1

    Hi. Basically I've build an application that connect's whith a Firebird Database from another software. This database charset is set to "NONE". On Linux, I've connected with QIBASE driver using:

    db = QSqlDatabase::addDatabase("QIBASE");
    db.setHostName("xxx.xxx.xxx.xxx");
    db.setConnectOptions("ISC_DPB_LC_CTYPE=Latin1");
    db.setPort(xxxx);
    db.setDatabaseName("C:/SGH.GDB");
    db.setUserName("SYSDBA");
    db.setPassword("masterkey");
    

    But on Windows, I'm using QODBC3 so I don't need to compile Qt myself with the IBASE driver. The problem is on Windows, some characters are not displaying. On Linux was the same, but db.setConnectOptions("ISC_DPB_LC_CTYPE=Latin1") solved my problem.

    I'm using on Windows exactly this:

    db = QSqlDatabase::addDatabase("QODBC3");
    db.setHostName("localhost");
    db.setConnectOptions("ISC_DPB_LC_CTYPE=Latin1");
    db.setDatabaseName("SGH");
    

    But seems that setConnectOptions has no effect and I can't see the characters there are not displayed. Anyone can help me?

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

      Ok. So I discovered that the option ISC_DPB_LC_CTYPE is not available for QODBC and decided to build the QIBASE plugin. I've run qmake with the correct params and mingw32-make after. Everything compiles normal, but QT don't show the driver in the list of available drivers. There's something else that I should do?

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to devnet,

        Might be a silly question but: did you install the plugin ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        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