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. ODBC Driver issue
Qt 6.11 is out! See what's new in the release blog

ODBC Driver issue

Scheduled Pinned Locked Moved General and Desktop
14 Posts 4 Posters 8.7k 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.
  • L Offline
    L Offline
    loladiro
    wrote on last edited by
    #5

    Does the Backend DB you use support Unicode? If so, could you post your DB structure to make sure there's no error in it.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Theophilus
      wrote on last edited by
      #6

      I'm using MaxDB (Version 7.6). The Table "DBPARAMETERS" says "_UNICODE" = "NO" and "DEFAULT_CODE" = "ASCII", which means that the varchar datatype is stored as ascii. However, the same software with an older Qt-Version (4.1) displays the Umlauts correctly.
      Here's some background information: I've been trying to integrate an older software into a new environment. The old software was compiled in VS2003 with Qt 4.1. Now I've compiled it in VS2010 with Qt 4.7.3. Both versions run properly on Windows 7 with the same ODBC-driver. However, the old one displays the Umlauts correctly, while the new one does not. Therefore, I think it is the newer Qt-Version that is giving me a hard time.

      Know Yourelf - if you can...

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Theophilus
        wrote on last edited by
        #7

        This webside says that MaxDB up to and including version 7.6 uses the ASCII-characterset ISO 8859/1.2 (if you chose to use Ascii): http://maxdb.sap.com/doc/7_7/44/bb285be00215b2e10000000a155369/content.htm

        Know Yourelf - if you can...

        1 Reply Last reply
        0
        • L Offline
          L Offline
          loladiro
          wrote on last edited by
          #8

          Try
          @
          QTextCodec::setCodecForLocale(QTextCodec::codecFromName("latin1"));
          @
          at the beginning of your application.

          1 Reply Last reply
          0
          • T Offline
            T Offline
            Theophilus
            wrote on last edited by
            #9

            Neither
            @
            QTextCodec::setCodecForLocale(QTextCodec::codecForName("Latin1"));
            @
            nor
            @
            QTextCodec::setCodecForLocale(QTextCodec::codecForName("latin1"));
            @
            works.

            Know Yourelf - if you can...

            1 Reply Last reply
            0
            • T Offline
              T Offline
              Theophilus
              wrote on last edited by
              #10

              The following code changes the "�" to a "?". I do not know if that helps at all, to get to the source of the error.

              Original code:
              @
              QString name =q2.value(1).toString(); //q2 being the QSqlQuery
              @
              Changed code (that changes the "�" to a "?"):
              @
              QByteArray encodedString = q2.value(1).toByteArray();
              QTextCodec *codec = QTextCodec::codecForName("ISO 8859-1");
              QString name = codec->toUnicode(encodedString);
              @

              Know Yourelf - if you can...

              1 Reply Last reply
              0
              • E Offline
                E Offline
                EukeSnud
                wrote on last edited by
                #11

                Qt Version is 4.7.3
                Db Version is Oracle Enterprise 11.2.0.1.0
                Os is Win7 Ultimate x64

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  Theophilus
                  wrote on last edited by
                  #12

                  Anyone any idea???

                  Know Yourelf - if you can...

                  1 Reply Last reply
                  0
                  • E Offline
                    E Offline
                    EukeSnud
                    wrote on last edited by
                    #13

                    bump
                    Still having this issue...

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      Sebtm
                      wrote on last edited by
                      #14

                      I have the same problem with a Visual Fox Pro database with the ISO Latin-1 character encoding. I use Qt 4.7.4.

                      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