Connect to InterBase (FireDAC)
Go Up to Database Connectivity (FireDAC)
This topic describes how to connect to Embarcadero InterBase.
Contents
Supported Versions
The FireDAC native driver supports Embarcadero InterBase Server, Desktop, Developer, ToGo, and IBLite editions version 6 and later.
To connect to Firebird or to the Jaffil server, use the FireDAC Firebird driver.
Client Software
Windows Client Software
FireDAC requires the following x86 or x64 client software to be installed on the workstation:
- InterBase Server:
- Win32: The GDS32.DLL library to connect to the InterBase Server, Desktop, or Developer from x86 applications.
- Win64: The IBCLIENT64.DLL library to connect to the InterBase Server, Desktop, or Developer from x64 applications.
- InterBase ToGo:
- Win32: The IBTOGO.DLL library to work with the database using the embedded InterBase ToGo from x86 applications.
- Win64: The IBTOGO64.DLL library to work with the database using the embedded InterBase ToGo from x64 applications.
You can put the required files in:
- a folder listed in your PATH environment variable (for example, <Windows>\SYSTEM32).
- your application EXE folder.
- any other folder and specify in FDDrivers.ini:
[IB]
VendorLib=<folder>\gds32.dll
If the InterBase client library has not been installed properly, an exception is raised when you try to connect:
[FireDAC][Phys][IB]-314. Cannot load vendor library [gds32.dll]. The specified module could not be found. Check [gds32.dll], which is located in one of the PATH directories or in the application EXE directory.
macOS Client Software
FireDAC requires:
- the libgds.dylib x86 client library to connect to the InterBase server. With RAD Studio, use Project > Deployment > Add Featured Files > InterBase Client\OSX32.
- the libibtogo.dylib x86 embedded InterBase. With RAD Studio use Project > Deployment > Add Featured Files > InterBase ToGo\OSX32.
iOS Client Software
FireDAC requires:
- For 64-bit iOS Device - the libibtogo.a embedded InterBase as ARM static library. With RAD Studio use Project > Deployment > Add Featured Files > InterBase ToGo\iOSDevice64.
Note that it is impossible to choose the linkage mode.
Android Client Software
FireDAC requires:
- the libibtogo.a embedded InterBase as ARM static library. With RAD Studio use Project > Deployment > Add Featured Files > InterBase ToGo\Android.
Note that it is impossible to choose the linkage mode.
Linux Client Software
FireDAC requires:
- the libgds.so x64 client library to connect to the InterBase server. With RAD Studio, use Project > Deployment > Add Featured Files > InterBase Client\Linux.
- the libibtogo.so x64 embedded InterBase. With RAD Studio use Project > Deployment > Add Featured Files > InterBase ToGo\Linux.
Driver Linkage
To link the driver:
- drop a TFDPhysIBDriverLink and TFDConnection components from the Tool Palette
- or include the FireDAC.Phys.IB unit in the uses clause.
Connection Definition Parameters
To connect to InterBase, most applications require that you specify the DriverID, Protocol, Server, Database, User_Name, Password, and CharacterSet connection definition parameters (see Defining Connection (FireDAC) for details).
DriverID=IB or DriverID=IBLite
Parameter | Description | Example value |
---|---|---|
Database |
The database name to attach. The value can be:
For an embedded database, a path can include path variables. |
|
OSAuthent |
Note: Only for DriverID = IB.
Controls the authentication mode:
|
Yes |
User_Name | The user name. | sysdba |
Password | The user password. | masterkey |
CharacterSet | Specifies the character set to use. We strongly recommend you to explicitly set the CharacterSet parameter to one of the following values:
|
WIN1252 |
ExtendedMetadata |
Controls the extended description of the query result sets:
|
False |
Port |
Note: Only for DriverID = IB.
The TCP/IP port on which the InterBase server is listening. By default, the port is equal to the gds_db defined in services. Typically, it is equal to 3050. When gds_db is not defined, then you should set the Port parameter to the required value. |
3051 |
Protocol |
Note: Only for DriverID = IB.
The protocol used to connect to the DB server. It can be one of the following values:
If the Protocol parameter is specified, FireDAC builds full database paths using the appropriate Protocol format and the Server and Database parameter values. |
TCPIP |
Server |
Note: Only for DriverID = IB.
Specifies the server address to connect to. The server parameter value is used only if the Protocol parameter is specified. |
127.0.0.1 |
InstanceName |
Note: Only for DriverID = IB.
The InterBase instance name. Supported starting from InterBase 2007. |
srv2 |
SQLDialect |
Note: Only for DriverID = IB.
The SQL Dialect to use for connecting. Three is the default value. |
1 |
RoleName |
Note: Only for DriverID = IB.
The default role name. |
Admin |
OpenMode |
Specifies how to open a database. The following modes are supported:
|
Open |
DropDatabase |
Controls the deletion of an existing database:
|
Yes |
PageSize | The page size used for the newly created database if CreateDatabase = Yes. 4096 is the default value. | 8192 |
IBAdvanced | The ';' separated list of additional parameters. You can find the full list of the supported parameters in the FireDAC.Phys.IBWrapper unit (see the DPBInfos constant array). You can find the description of each Code listed there in the Interbase manuals. | |
GUIDEndian | It defines how the GUID value is represented on the client. 'Little' is the default value. | Big |
Use Cases
Using a Secure Connection
To use TLS/SSL encryption, pass the key-value pair ssl=true
on the value of the Database parameter as follows:
DriverID=IB Database=my.interbasehost.net/3065?ssl=true?serverPublicFile=C:\PublicCertFileOnClient\CertFile.pem??:C:/DB/TEST.IB User_Name=sysdba Password=masterkey CharacterSet=UTF8 ExtendedMetadata=True
For more details, see Chapter 5, starting with page 5, of the InterBase Operations Guide manual.
Other Usage Cases
- Connect to a database running on a remote server via TCP/IP protocol:
DriverID=IB Database=C:\ib\ADDEMO_IBXE3.gdb Protocol=TCPIP Server=IBSrv User_Name=sysdba Password=masterkey CharacterSet=win1252 ExtendedMetadata=True
- Connect to a database running on a remote server via TCP/IP protocol:
DriverID=IB Database=IBSrv:C:\ib\ADDEMO_IBXE3.gdb User_Name=sysdba Password=masterkey CharacterSet=utf8
- Connect to a local database:
DriverID=IB Database=C:\ib\ADDEMO_IBXE3.gdb User_Name=sysdba Password=masterkey CharacterSet=win1251
- Connect to an InterBase ToGo database:
Drop the TFDPhysIBDriverLink component to the form and set its VendorLib to <your path>\ibtogo.dll or use virtual driver definition.
DriverID=IB Database=C:\ib\ADDEMO_IBXE3.gdb User_Name=sysdba Password=masterkey CharacterSet=utf8
- Connect to a database file in Documents folder on iOS Device:
DriverID=IB User_Name=sysdba Password=masterkey Database=$(DOC)/ADDEMO.GDB SQLDialect=3 CharacterSet=UTF8 ExtendedMetadata=True
- Connect to an encrypted database file on the external storage on the Android device:
DriverID=IB User_Name=sysdba Password=masterkey Database=$(DOC)/ADDEMO.GDB SQLDialect=3 CharacterSet=UTF8 ExtendedMetadata=True SEPassword=12345
- Connect to an IBLite database:
DriverID=IBLite Database=C:\ib\ADDEMO_IBXE3.gdb User_Name=sysdba Password=masterkey CharacterSet=utf8
See Also
- Common Connection Parameters
- FAQs
- How to configure FireDAC Drivers
- How to manage FireDAC Connection Definitions
- Tutorial: Using FireDAC from a Multi-Device Application on Desktop Platforms
Samples
- FireDAC InterBase sample