Firebird is a typical embedded database. The so-called embedded database, simply that does not need a separate database server installation configuration, only in the application software to join the client interface can be directly to a file as a database access. And Firebird is from Borland Company's InterBase database, for the latter of the free version of the open source. The earliest contact of the author is SQLite, and later because of some of its SQL features are not perfect, so found the full support SQL92 standard, support the majority of SQL-99 standard function Firebird. Only in the end it was used for scattered practiced hand projects, and did not go into the study.
The QT manual has been given a InterBase driver compilation method, which is modified to support Firebird.
1 , modify the IBase project file Ibase.pro as follows:
TARGET  = QSQLIBASEHEADERS  =  /.. /.. /SQL/DRIVERS/IBASE/QSQL_IBASE.HSOURCES  = MAIN.CPP    &NBSP, .... /.. /.. /sql/drivers/ibase/qsql_ibase.cppincludepath += c:\firebird\firebird_2_1\includelibs += c : \firebird\firebird_2_1\lib\fbclient_ms.libunix:!contains ( LIBS, .*gds.* ):!contains ( libs , .*libfb.* ): Libs *= -lgdswin32:!contains ( LIBS, .*gds.* ):!contains ( LIBS, .*fbclient.* ) { !win32-borland:libs *= -lfbclient _ms win32-borland:libs += gds32.lib}include (.. /QSQLDRIVERBASE.PRI)
2. Compile and build qt plugin:
Enter%qtdir%\src\plugins\sqldrivers\ibase under command line;
Type qmake ibase.pro carriage return;
Type make enter.
Note: (1), to ensure that the relevant environment variable settings
(2),%path% add%firebird%\bin. (Required on QT data, not tested for mandatory requirements)
3, copy embed version of Fbembed.dll, Icuin30.dll, Icudt30.dll, Icuuc30.dll to the Execution program directory, and Rename the Fbembed.dll to Fbclient.dll.
4. The connection test code is as follows:
Qsqldatabase db = Qsqldatabase::adddatabase ("Qibase", "Firebird"); Db.setdatabasename ("E:\\cuzn.fdb"); Db.setusername ("SYSDBA"); Db.setpassword ("Masterkey"); if (Db.open ()) {qmessagebox MB; Mb.settext ("OK"); Mb.exec (); Db.close (); }
Welcome to visit CuZn Station
This article is from the "CuZn Station" blog, please be sure to keep this source http://cuzn1024.blog.51cto.com/9214612/1621118
QT Compilation supports Firebird database