Results 1 to 2 of 2

Thread: how to use ms access files

  1. #1
    Join Date
    Jul 2009
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default how to use ms access files

    hi all,

    i want to access an ms access file and use it, but i can't. i couldn't find any tutorial on this, can anyone help?

    thanks
    mehmet

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to use ms access files

    you should use code like this
    Qt Code:
    1. ...
    2. QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
    3. db.setDatabaseName("DRIVER={Microsoft Access Driver (*.mdb)};FIL={MS Access};DBQ=" + mdb);
    4. if (!db.open()) {
    5. QMessageBox::critical(this, tr("Error"), db.lastError().text());
    6. return;
    7. }
    8. ...
    To copy to clipboard, switch view to plain text mode 
    where mdb it is path to mdb file, e.g. "C:/mdbs/my.mdb".
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

Similar Threads

  1. Access UI Components from different source files
    By cevou in forum Qt Programming
    Replies: 3
    Last Post: 13th February 2009, 23:44
  2. Access violation when reading big text files
    By robertson1 in forum General Programming
    Replies: 0
    Last Post: 18th September 2008, 06:59
  3. How to access files from specific folder using QContentSet
    By hrudhay in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 30th June 2008, 19:57
  4. visual studio project files - adding extra files
    By luf in forum Qt Programming
    Replies: 3
    Last Post: 13th June 2008, 21:05
  5. Replies: 5
    Last Post: 22nd September 2006, 08:04

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.