Enabling Connection Failover Using the Adaptive Server ODBC Driver Connection String

Use connection string to enable the connection failover in the Adaptive Server ODBC Driver.

Set the HASession connection string property to 1.
You can use SQLDriverConnect to specify a connection string. For example:
Driver=AdaptiveServerEnterprise;server=server1;
port=port1;UID=sa;PWD=;HASession=1;
AlternateServers=server2:port2,...,serverN:portN;
The preceding example defines server1 and port1 as the primary server and port. If Adaptive Server ODBC Driver fails to establish connection to the primary server, and alternate servers are defined, it searches through the ordered list of servers and ports specified in the Alternate Servers field until a connection is established or until the end of the list is reached.