RegisterDatabase Statement

See AlsolanRegisterDatabaseSee                 ExamplelanRegisterDatabaseEx>Low

Description

Makes connect information for an ODBC data source name available for use by the OpenDatabase function.

Syntax

RegisterDatabase dsn, driver, silent, attributes

Remarks

The RegisterDatabase statement has the following parts:

Part                 Description

 

dsn                   A string expression1330R89 that is a name used in the OpenDatabase function and refers to a block of descriptive information about the data source.  For example, if the data source is an ODBC remote database, it would be the name of the server.

driver               A string expression that is the name of the ODBC driver.  This is not the name of the ODBC driver DLL file.  For example, "SQL Server" or "Oracle" are driver names, but "SQLSRVR.DLL" is the name of a DLL file.  You must have ODBC and the appropriate driver already installed.

silent                A numeric expression71RISN that is True if you do not want to display the ODBC driver dialogs that prompt for driver-specific information, or False if you do want to display the ODBC driver dialogs.  If silent is True, then attributes must contain all the necessary driver-specific information or the dialog will appear anyway.

attributes          String expression that is a list of keywords to be added to the ODBC.INI file.  The keywords are in a carriage-return-delimited string.

 

If the database is already registered in the ODBC.INI file, the entry is updated.

If RegisterDatabase fails for any reason, no changes are made to the ODBC.INI file, and an error occurs.

For more information about ODBC drivers such as SQL Server or Oracle, see the Help file provided with the driver.