AseConnection Constructors

Initializes an AseConnection object. The connection must then be opened before you can carry out any operations against the database.

Syntax 1

AseConnection( )

Syntax 2

AseConnection( string connectionString )

Parameters

connectionString – an Adaptive Server connection string. A connection string is a semicolon-separated list of keyword-value pairs.

Note: Data Source, DataSource, Secondary Data Source, Secondary DataSource are special keywords. In addition to being the server name, they can also be formatted as
DataSource=servername,port
or
DataSource=servername:port

For example, DataSource=gamg:4100 sets the server name to “gamg” and the port to “4100.” In this case, the Port keyword would not be needed in the connection string.

Example

The following statement initializes an AseConnection object for a connection to a database named “policies” running on an Adaptive Server database server named “HR-001.” The connection uses a user ID of “admin” with a password of “money.”

"Data Source='HR-001';
Port=5000; UID='admin';
PWD='money';
Database='policies';"
Related concepts
Distributed Transactions