meta data for this page
  •  

CREATE CONNECTION

Please note that this function is deprecated. Please use ibec_CreateConnection instead.


Creates a named connection to a database.

Syntax

CREATE CONNECTION connection DBNAME 'filespec'
   USER 'username' PASSWORD 'password'
   [CLIENTLIB 'libfile']
   [NAMES charset]
   [SQL_DIALECT dialect]
   [ROLE rolename] 
Argument Description
connection Connection name.
DBNAME 'filespec' Database file name; can include path specification and node.
USER 'username' String that specifies a user name for use when attaching to the database. The server checks the user name against the security database (Server security ISC4.GDB / SECURITY.FDB). User names are case insensitive on the server.
PASSWORD 'password' String, up to 8 characters in size, that specifies password for use when attaching to the database. The server checks the user name and password against the security database. Case sensitivity is retained for the comparison.
CLIENTLIB 'libfile' Client library file name; default: gds32.dll.
NAMES charset Name of a character set that identifies the active character set for a given connection; default: NONE.
SQL_DIALECT dialect The SQL Dialect for database access, either 1, 2, or 3.
ROLE rolename String, up to 31 characters in size, which specifies the role that the user adopts on connection to the database. The user must have previously been granted membership in the role to gain the privileges of that role. Regardless of role memberships granted, the user has the privileges of a role at connect time only if a ROLE clause is specified in the connection. The user cannot adopt more than one role per connection, and cannot switch roles except by reconnecting.

Example

execute IBEBlock
as
begin
  CREATE CONNECTION Con1 DBNAME 'localhost:c:\mydata\mydb.gdb'
  USER 'SYSDBA' PASSWORD 'masterkey'
  CLIENTLIB 'C:\Program Files\Firebird\Bin\fbclient.dll'
  SQL_DIALECT 3 NAMES WIN1251 ROLE ADMIN;

  USE Con1;

  ...
 
  CLOSE CONNECTION Con1;
end