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. Charset problem with SQLDatabase in QT Creator 2.8.1 ( QT 5.1.1)
Forum Updated to NodeBB v4.3 + New Features

Charset problem with SQLDatabase in QT Creator 2.8.1 ( QT 5.1.1)

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

    Hey guys, I read Values from a *.mdb Databse and they are shown as ?? symbols :(
    Even using qDebug << "output" ... I get "?" symbols, but if I show the database in MS Access, it looks normal.

    Encoding problem, right ? so How do I fix that ?

    C++ Code I use to read:
    @QSqlDatabase mgDb = QSqlDatabase::addDatabase("QODBC");
    QSqlQuery query;
    // Open connection.
    mgDb.setHostName("localhost");
    mgDb.setDatabaseName("DRIVER={Microsoft Access Driver (*.mdb)};FIL={MS Access};DBQ=file://../Daten/Datenbank1.mdb");

    if(mgDb.open() == false){
      qDebug() << "ODBC::open() : error opening connection : "
         << mgDb.lastError().text() << "\n";
    }
    QStringList list = mgDb.tables(QSql::Tables);
    for(int i=0;i<list.size(); ++i){
      qDebug() << "Table names " << list.at(i) << endl;
    }
    QSqlDriver const * driver = query.driver();
    QSqlRecord rec = driver->record("EntityTypeTbl");
    query.prepare(QObject::trUtf8("SELECT * FROM Kurse"));
    query.exec&#40;&#41;;@
    
    1 Reply Last reply
    0
    • K Offline
      K Offline
      KYL3R
      wrote on last edited by
      #2

      does nobody know ? :/

      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