Storing SQL Anywhere connection parameters

You use an ODBC data source to connect to an ODBC database. The client computer requires an ODBC data source for each database connection.

The ODBC data source contains a set of connection parameters. You can store sets of SQL Anywhere connection parameters as an ODBC data source, in either the Windows registry or as files.

For SQL Anywhere, the use of ODBC data sources goes beyond Windows applications using the ODBC interface:

  • SQL Anywhere client applications on Unix and Windows operating systems can use ODBC data sources.

  • ODBC data sources can be used by all SQL Anywhere client interfaces except jConnect and Open Client. The data source is stored in a file on Unix and Windows Mobile operating systems.

If you have a data source, your connection string can name the data source to use:

  • Data source   Use the DataSourceName (DSN) connection parameter to reference a data source in the Windows registry:
    DSN=my-data-source

  • File data source   Use the FileDataSourceName (FILEDSN) connection parameter to reference a data source held in a file:
    FileDSN=mysource.dsn

Note

When creating a connection string, it can contain the name of an ODBC data source that contains connection parameters, and connection parameters that are specified explicitly. If a connection parameter is specified in the connection string and in the ODBC data source, the value that is specified explicitly takes precedence.