Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. QODBC and unixODBC/mdbtools
Forum Updated to NodeBB v4.3 + New Features

QODBC and unixODBC/mdbtools

Scheduled Pinned Locked Moved 3rd Party Software
1 Posts 1 Posters 2.0k 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.
  • I Offline
    I Offline
    i92guboj
    wrote on last edited by
    #1

    Hello.

    The title says it all. I am trying to open an accdb file from qt in linux, so far , I've managed to get to the point where mdbtools can query the .accdb file, and it shows correct results so far. So, unixODBC is working fine.

    But, when trying to query it from qt, I only get errors, and more errors.

    The thing is something like this:

    @ QSqlDatabase *import = new QSqlDatabase;
    *import = QSqlDatabase::addDatabase("QODBC", "IMPORT");
    import->setDatabaseName("kook");
    ...
    if(!import->open())
    {
    qDebug() << Q_FUNC_INFO << "failed to open import database";
    return false;
    }
    else
    {
    qDebug() << "database was downloaded, open, and it is ready to be imported";
    }
    ...
    query_import.exec("SELECT ref,desc,pvp,cal,alt_ref,foto FROM articulos");

    db->exec&#40;"BEGIN TRANSACTION;"&#41;;
    
    while(query_import.next())
    {
    ...
    }
    

    @

    The database opens, though it throws this:

    @Error at Line : syntax error near 'test'
    syntax error near 'test'
    Got no result for 'select 'test'' command
    QODBCDriver::checkHasSQLFetchScroll: Warning - Driver doesn't support scrollable result sets, use forward only mode for queries
    database was downloaded, open, and it is ready to be imported @

    The last line is from my qDebug() above.

    Then, when querying it seems like the query has not returned a single line.

    The same query, when run from the isql interface in command line, returns the full table contents (except for the foto field, of course).

    So, has anyone any experience with this kind of thing? The same code worked great in sqlite, but the customer is always right (tm).

    Thank you for any guidance, it will be greatly appreciated. :)

    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