|
<< Click to Display Table of Contents >> Databases |
![]() ![]()
|
A database is an organized collection of related tables. To access data in a table, the session first must gain access to the database with a DbiOpenDatabase call, which returns a database handle to the database.
Standard databases
The Borland Database Engine (BDE) classifies file-based databases such as Paradox, dBASE, FoxPro, Access, and text as "standard" databases. Files within a standard database are normally grouped together in the current directory associated with a standard database, although an application can expand its database by referencing, by fully qualified pathname, any accessible file either locally or on the network.
SQL databases
A SQL database usually resides on a server. The client application must first log in, establishing a connection to the database server. This requires supplying the appropriate user name and password. When you call DbiOpenDatabase, BDE logs into the server and establishes a connection, just as with standard databases.
Aliases
An alias is a short name referencing a database. Database references within applications can use alias names, making your applications portable.
You can change the definition of an alias at any time by using the BDE Administrator BDEADMIN.EXE. All references to the alias within the application automatically refer to the new definition of the alias.
Aliases for standard databases
For standard databases, an alias is a name you assign as a shortcut to a directory containing the files you want to access. You can give a long path name a short alias name. When you open a database with such an alias, tables in that directory can be opened by supplying only the table name without supplying the full path.
Aliases for SQL databases
For SQL databases, properties must be defined for the alias. These properties can vary depending on the SQL driver. Alias properties can include:
•User name
•Server name
•Open mode
•Default SQL query mode
•Schema cache size
•Language driver
After a SQL database alias is established, the client application can use it the same way it uses an alias for a standard database.