ASA Getting Started
Connecting Your Application to its Database
ODBC data sources are a convenient way of saving connection parameters for repeated use. Once you have a data source, your connection string can simply name the data source to use:
DSN=my data source
The Connect dialog in Sybase Central and Interactive SQL has fields for entering an ODBC Data Source Name or ODBC Data Source File.
This section describes how to create a simple ODBC data source in Windows.
For more detailed information, see Configuring ODBC data sources using the ODBC Administrator.
For information about setting up ODBC data sources on UNIX, see Using ODBC data sources on UNIX.
To create a simple ODBC data source
Start the ODBC Administrator:
From the Windows Start menu, choose Programs
or
From Sybase Central, choose Tools
The ODBC Data Source Administrator appears, displaying a list of the data sources you currently have installed on your computer. For example,
On the User DSN tab, click Add.
The Create New Data Source wizard appears.
Select Adaptive Server Anywhere 9.0 from the list of drivers, and click Finish.
The Adaptive Server Anywhere ODBC Configuration dialog appears.
Many of the fields in this dialog are optional. Click the Help button at the bottom of each tab for a description of all the fields on that tab. You probably only need to use the following parameters:
Data Source Name (ODBC tab) Type a name that will appear in the Connect dialog. It can contain spaces, but should be short.
For example, for the database created in the previous chapter you could enter a data source name of My Sample.
User ID (Login tab) The database user ID you will use to connect. If you omit the user ID, you will be prompted for it when you attempt to connect.
For newly created databases, the default user ID is DBA.
Password (Login tab) You should omit or encrypt the password if there are security concerns with having passwords stored on your machine. If you omit the password, you will be prompted for it when you attempt to connect.
The default password for the DBA user ID is SQL.
Database File (Database tab) You can select a database file by browsing your machine.
For the database created in the previous chapter you would enter c:\temp\mysample.db.
When you have specified the parameters you need, click OK to create the data source and close the dialog.
For descriptions of the fields on each tab in the ODBC Configuration dialog, see Configuring ODBC data sources using the ODBC Administrator.
For a full description of database connections, see Connecting to a Database.
For more information about ODBC data sources, see Working with ODBC data sources.