Connect to InterBase (FireDAC)

From Appmethod Topics
Jump to: navigation, search

Go Up to Database Connectivity (FireDAC)

This topic describes how to connect to Embarcadero InterBase.

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.

Windows Client Software

FireDAC requires the following x86 or x64 client software to be installed on the workstation:

  • The GDS32.DLL library to connect to the InterBase Server, Desktop, or Developer from x86 applications.
  • The IBCLIENT64.DLL library to connect to the InterBase Server, Desktop, or Developer from x64 applications.
  • The IBTOGO.DLL library to work with the database using the embedded InterBase ToGo from x86 applications.
  • 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.

Mac OS X Client Software

FireDAC requires:

  • the libgds.dylib x86 client library to connect to the InterBase server. With Appmethod, use Project -> Deployment -> Add Featured Files -> InterBase Client\OSX32.
  • the libibtogo.dylib x86 embedded InterBase. With Appmethod use Project -> Deployment -> Add Featured Files -> InterBase ToGo\OSX32.

iOS Client Software

FireDAC requires:

  • For iOS Simulator - the libibtogo.dylib x86 embedded InterBase. With Appmethod use Project > Deployment > Add Featured Files > InterBase ToGo\iOSSimulator.
  • For iOS Device - the libibtogo.a embedded InterBase as ARM static library. With Appmethod use Project > Deployment > Add Featured Files > InterBase ToGo\iOSDevice.

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 Appmethod use Project -> Deployment -> Add Featured Files -> InterBase ToGo\Android.

Note that it is impossible to choose the linkage mode.

Driver Linkage

To link the driver:

Connection Definition Parameters

To connect to InterBase, most applications require you to specify DriverID, Protocol, Server, Database, User_Name, Password, and CharacterSet.

We strongly recommend you to explicitly set the CharacterSet to:

  • UTF8, if your application needs to support Unicode. For details, see Unicode Usage (FireDAC).
  • WIN1250 for Central Europe.
  • WIN1251 for Cyrillic.
  • WIN1252 for Western Europe, America.
  • and so on.

DriverID=IB

Parameter Description Example value
Database

The database name to attach. The value can be:

  • database file path.
  • full database path, including server address.

For an embedded database, a path can include path variables.

  • C:\ib\ADDEMO_IB2007.IB
  • 127.0.0.1:C:\ib\ADDEMO_IB2007.IB
  • \\MySrv\C:\ib\ADDEMO_IB2007.IB
OSAuthent

Controls the authentication mode:

  • Yes -- use Windows authentication.
  • No -- use DBMS authentication. It is the default value.
Yes
User_Name The user name. sysdba
Password The user password. masterkey
CharacterSet The character set to use. WIN1252
ExtendedMetadata

Controls the extended description of the query result sets:

  • True -- FireDAC is getting column domain names additional to the other column attributes. If a column belongs to a domain with a name such as %BOOL%, it is described as dtBoolean. Also, if a table has an INSERT trigger, which reads a single sequence and assigns its value to a single column, then this column is described as an auto-incrementing one. Setting this option to True slightly slows down a dataset opening.
  • False -- FireDAC uses the restricted information about the query columns. It is the default value.
False
Protocol

The protocol used to connect to the DB server. It can be one of the following values:

  • Local -- connect to a locally running server, to an embedded server, or to a server using an alias.
  • NetBEUI -- connect using Microsoft NetBIOS protocol.
  • SPX -- connect using Novell SPX protocol.
  • TCPIP -- connect using TCP/IP protocol.

If the Protocol parameter is specified, FireDAC builds full database paths using the appropriate Protocol format and Server and Database parameter values.

TCPIP
Server Server address to connect to. The server parameter value is used only if the Protocol parameter is specified. 127.0.0.1
InstanceName The InterBase instance name. Supported starting from InterBase 2007. srv2
SQLDialect The SQL Dialect to use for connecting. Three is the default value. 1
RoleName The default role name. Admin
CreateDatabase

Controls the creation of a new database:

  • Yes -- create a new database file specified in the Database parameter, immediately after connecting to the server.
  • No -- do not create. It is the default value.
Yes
DropDatabase

Controls the deletion of an existing database:

  • Yes -- drop the database file specified in the Database parameter, immediately after disconnecting from the server.
  • No -- do not drop. It is the default value.
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 uADPhysIBWrapper unit, searching for the DPBInfos constant array. You can find the description of each Code listed there in the Interbase manuals.

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 a 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
CharacterSet=utf8
  • Connect to a InterBase using SSL:

For more details, see Chapter 5, starting with page 5, of the InterBase XE3 Operations Guide manual.

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
  • Connect to a database file in Documents folder on iOS device or simulator:
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

See Also