Database Engines:ads

DacSession connection parameters Professional

Establishing a session to the Advantage Database Server requires a properly setup connection string. For a generic discussion about connection strings and the DacSession() class see the Xbase++ Reference documentation. For connection string examples see Different methods to connect to the server. The table below lists the generic connection parameters supported by the ADSDBE:

Standard name/value pairs in a connection string supported by the ADSDBE
Name Value description
DBE *) The database engine for accessing the remote data source
SERVER The server name where the data source resides
UID The user ID required for login
PWD The password required for login
  1. must be DBE=ADSDBE

The ADSDBE introduces an additional set of connection attributes such as Server types and Server options. Server types are used to control the types of Advantage Database Servers to which the ADSDBE can connect. Server options are used to specify options when connecting to an Advantage Database Server.

Advantage Server type
Attribute Description
ADS_REMOTE_SERVER Advantage Database Server
ADS_AIS_SERVER Advantage Internet Server
ADS_LOCAL_SERVER Advantage Local Server

The Advantage Server type setting changes the default Advantage server type to which the ADSDBE will try to connect. If a connection to an Advantage Server over the internet via IP/Port is made the ADS_AIS_SERVER type must be specified. The default server type used by the ADSDBE is ADS_REMOTE_SERVER. More than one server types can be specified in a connection string, each of seperated by a semicolon. Using a connection string as below establishes a connection to the local-server on the \\alaska01\data share, even if a Advantage Server is present.

01: cConnStr := "SERVER=\\alaska01\data;ADS_LOCAL_SERVER;UID=demo;PWD=demo" 
02: oS       := DacSession():New("DBE=ADSDBE;"+cConnStr) 

Server options
Attribute Description
ADS_INC_USERCOUNT Each connection counts as user
ADS_STORED_PROC_CONN Required when implementing stored procedures
ADS_COMPRESS_ALWAYS Compress all data communication
ADS_COMPRESS_NEVER No compression
ADS_COMPRESS_INTERNET Compress only if connection type is ADS_AIS_SERVER

ADS_INC_USERCOUNT

Naturally, if the same workstation connects multiple times to the server the user count is only incremented once while the connection count is incremented with each connection established. If the ADS_INC_USERCOUNT option is used, the user count on the Advantage Database Server will be incremented with each connection established. This options must be used when developing middleware applications accessing the Advantage Database Server to conform with the server license agreement.

ADS_STORED_PROC_CONN

Used to avoid the increase of the user count on the server. If implementing a stored procedure this option must be used. Otherwise execution of a stored procedure would increment the user count.

ADS_COMPRESS_ALWAYS

If this option is specified, then all data communications between the client and server will be compressed.

ADS_COMPRESS_NEVER

If this option is specified, then compression will not be used for communications between the client and server.

ADS_COMPRESS_INTERNET

If this option is specified, then all data communications for ADS_AIS_SERVER connections will be compressed. The sample code below establishes a connection to an ADS server over the internet and ensures that data communication is compressed for performance reason.

01: cConnStr := "SERVER=\\ads001.alaska-software.com\data:6262;" 
02: cConnStr += "ADS_AIS_SERVER;ADS_COMPRESS_INTERNET;UID=demo;PWD=demo" 
03: oS       := DacSession():New("DBE=ADSDBE;"+cConnStr) 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.