Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.0 » SQL Anywhere Server - Database Administration » Starting and Connecting to Your Database » Connecting to a database

 

Working with ODBC data sources

Microsoft defines the Open Database Connectivity (ODBC) interface, which is a standard interface for connecting client applications to database management systems in the Windows environments. Many client applications, including application development systems, use the ODBC interface to access a wide range of database systems.

Caution

Storing user IDs, passwords (encrypted or unencrypted), and/or database keys in a data source is not secure. It is recommended that you do not store this information in a data source if the database contains sensitive data.

The SQL Anywhere ODBC driver is named dbodbc11.dll, and it is located in install-dir\bin32.

For more information about using SQL Anywhere with ODBC, see ODBC conformance.

You can use ODBC data sources to connect to SQL Anywhere databases from any of the following applications:

  • Sybase Central, Interactive SQL, and the SQL Anywhere Console utility.
  • All the SQL Anywhere utilities.
  • PowerDesigner Physical Data Model and InfoMaker.
  • Any application development environment that supports ODBC, such as Microsoft Visual Basic, Sybase PowerBuilder, and Borland Delphi.
  • SQL Anywhere client applications on Unix. On Unix, the data source is stored as a file.
Where data sources are held

You connect to an ODBC database using an ODBC data source. You need an ODBC data source on the client computer for each database you want to connect to.

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.

If you have a data source, your connection string can simply 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

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

  • SQL Anywhere client applications on Unix can use ODBC data sources, as well as those on Windows operating systems.
  • ODBC data sources can be used by all SQL Anywhere client interfaces except jConnect and Open Client.
Note

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


Creating an ODBC data source
Generating ODBC data sources using the Connect window
Creating ODBC data sources using the ODBC Administrator
Creating an ODBC data source from the command line
Creating an ODBC data source on Mac OS X
Using file data sources on Windows
Using ODBC data sources on Windows Mobile
Using ODBC data sources on Unix