QT Compilation supports Firebird database

Source: Internet
Author: User
Tags firebird database ibase interbase

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.