Defining ODBC external servers

The most common way of defining an ODBC-based server is to base it on an ODBC data source. To do this, you must create a data source (DSN) in the ODBC Administrator.

Once you have the data source defined, the USING clause in the CREATE SERVER statement should match the ODBC data source name.

For example, to configure an Adaptive Server Enterprise server named myase whose Data Source Name is also myase, use:

CREATE SERVER myase 
CLASS 'aseodbc' 
USING 'myase'

For more information on creating ODBC data sources for Sybase IQ, see “Creating and editing ODBC data sources”. For information on creating ODBC data sources for Adaptive Server Enterprise, see “Server class aseodbc”.

Using connection strings instead of data sources

If you do not wish to use data sources, you can supply a connection string in the USING clause of the CREATE SERVER statement.

To do this, you must know the connection parameters for the ODBC driver you are using. For example, a connection to an Sybase IQ may be as follows:

CREATE SERVER testasiq 
CLASS 'asaodbc'
USING 'driver=adaptive server IQ 12.0;
eng=testasaiq;dbn=asiqdemo;links=tcpip{}'

This defines a connection to an Sybase IQ database server named testasiq, database asiqdemo, using the TCP/IP protocol.

See also

For information specific to particular ODBC server classes, see: