How to access to dbf file in QT ?

  • Hi

    How to access to dbf file in QT ?

    System: Windows 7


  • Qt Champions 2016


    DBF is a file format typically used by database software. DBF stands for DataBase File. DBF files were originally used in dBase II and continued through to dBase Version IV. The DBF file format originated by Ashton-Tate, but is understood by Act!, Clipper,FoxPro, Arago, Wordtech, xBase, and similar database ordatabase-related products.

    DBF files can also be opened by Microsoft Excel and Microsoft Access.

    So what type of dbf are you talking?

    In windows there is driver via ODBC for dbase
    QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
    db.setDatabaseName("Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=/path/to/database");; // Ok
    QSqlQuery query = QSqlQuery("select * from table", db);

    ps. the driver normally comes with Access.
    It used to be avialable in

    but I have not tested newer version if still in there (dbase).
    pretty old now. :)

  • Thank you for so precise description.

    Everythng works :)

  • Qt Champions 2016

    dbase will never die! ;) (it seems)

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.