Navigation:  Advantage Crystal Reports > Using the Advantage Crystal Reports Driver >

Defining a Database Alias for use with Crystal Reports

Crystal Reports

Previous pageReturn to chapter overviewNext page

The most common way of connecting a Crystal Report to Advantage is through the use of aliases (see Configuring Crystal Reports at Runtime for a more advanced method). Aliases are added to the [DATABASES] section in the ADS.INI file located in the WINDOWS directory (by default). Advantage clients use the search path to locate the ads.ini file, so this file can be placed in your application's directory or anywhere in the search path of the client machine. The key name is the name of the alias and the value is the "Data Path", semicolon, followed by the first letter of the index type. For example, adding an alias name "MyAlias" with a data path of "C:\MYPATH" using index type ADT will cause "MyAlias=C:\MYPATH;A" to be written to the ADS.INI file under the [DATABASES] section.

The ADS.INI file can be modified using a text editor, programmatically through Windows ini manipulation APIs, or it can be modified using the Advantage Data Architect (via the Connection Repository).

Example ADS.INI file:

[Settings]

ADS_SERVER_TYPE=2

[Databases]

ADS_ADT=x:\MyAdtFiles;A

ADS_CDX=x:\MyDbfFiles;C

ADS_DD=x:\MyFiles\mydiction.add;D

 

The ADS_SERVER_TYPE key in the ADS.INI file can be used to select the Advantage server type(s) to use when obtaining an Advantage server connection. The available Advantage Server types are:ADS_REMOTE_SERVER which is the Advantage Database Server, ADS_AIS_SERVER which is the Advantage Internet Server, and ADS_LOCAL_SERVER which is the Advantage Local Server.

These Advantage server type constants are defined in the ACE.H and ACE.PAS files. ADS_REMOTE_SERVER has the value 2, ADS_AIS_SERVER has the value 4, and ADS_LOCAL_SERVER has the value 1. For example, if you wanted your Advantage application to attempt to connect to all Advantage server types, if necessary, you need to set the value for the ADS_SERVER_TYPE key to 7 (1 + 2 + 4 = 7). The default ADS_SERVER_TYPE value is to use ADS_REMOTE_SERVER and ADS_AIS_SERVER, which is 6 (2 + 4 = 6).