Opening a Database

From InterBase

Go Up to Working with Databases


After a database is declared, it must be attached with a CONNECT statement before it can be used. CONNECT:

  • Allocates system resources for the database.
  • Determines if the database file is local, residing on the same host where the application itself is running, or remote, residing on a different host.
  • Opens the database and examines it to make sure it is valid.

InterBase provides transparent access to all databases, whether local or remote. If the database structure is invalid, the on-disk structure (ODS) number does not correspond to one required by InterBase, or if the database is corrupt, InterBase reports an error, and permits no further access.

Optionally, CONNECT can be used to specify:

  • A user name and password combination that is checked against the security database of the server before allowing the connect to succeed. User names can be up to 31 characters. Passwords are restricted to 8 characters.
  • A SQL role name that the user adopts on connection to the database, provided that the user has previously been granted membership in the role. Regardless of role memberships granted, the user belongs to no role unless specified with this ROLE clause. The client can specify at most one role per connection, and cannot switch roles except by reconnecting.
  • The size of the database buffer cache to allocate to the application when the default cache size is inappropriate.

Topics

Advance To: