You can enable the Cluster Edition connection failover in the Adaptive Server ODBC Driver through its user interface.
Using the user interface to enable extended failover
Open the Adaptive Server Enterprise dialog box.
Go to the Connection tab.
Select Enable High Availability.
(Optional) Enter alternate servers and ports in the Alternate Servers field using this format:
server1:port1,server2:port2,...,serverN:portN;
In establishing a connection, the Adaptive Server ODBC Driver first attempts to connect to the primary host and port defined in the General tab of the Adaptive Server Enterprise dialog box. If Adaptive Server ODBC Driver fails to establish a connection, it then searches through the list of hosts and ports specified in the Alternate Servers field.
To use the connection string to enable the connection failover in 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.
If you are linking to the unixODBC Driver Manager, edit the Adaptive Server ODBC datasource template, odbc.ini, and reinstall the datasource using the unixODBC command line tool:
# odbcinst -i -s -f dsn_template_file
where dsn_template_file is the complete path to the Adaptive Server ODBC datasource template file.
If you are directly linking to the Adaptive Server ODBC Driver or the Sybase iAnywhere ODBC Driver Manager, modify the odbc.ini file to add the alternate servers. For example:
ODBC Data Source UserID=sa Password= Driver=Adaptive Server Enterprise Server=sampleserver Port=4100 Database=pubs2 UseCursor=1 HASession=1 AlternateServers=server2:port2,server3:port3;
The list of alternate servers specified in the GUI or the connection string is used
only during initial connection. After the connection is established
with any available instance, and if the client supports high availability,
the client receives an updated list of the best possible failover
targets from the server. This new list overrides the specified list.