Creating ODBC data sources

You need an ODBC data source on the client computer for each Windows database you want to access using ODBC. A data source describes how to get to data on a network. For example, a data source may include the name of a database, the server where it resides, and the network used to access the server.

NoteThe AUTOSTOP parameter is required in file data sources and odbc.ini files. It should always be set to NO.

On Windows XP and 2000, the ODBC Administrator adds new data sources for you. Each data source allows you to access a database over a network by means of ODBC.

StepsCreating an ODBC data source

  1. To start the ODBC Administrator on your Windows client system, select Sybase > Data Access > ODBC Data Source Administrator.

  2. In the ODBC Data Source Administrator, click Add on the User DSN tab.

  3. In the Create New Data Source dialog box, select the Adaptive Server IQ driver and click Finish.

  4. In the ODBC Configuration box, type the Data Source Name in the text box where your cursor is by default (Alt+s).

    On the ODBC tab, asiqdemo is typed in the Data source name box (Alt+s). Cursor Behavior option If required (Alt+f) is checked. Buttons are Select Translator (Alt+e) and Test Connection (Alt+C)
  5. Now click the Login tab. Type the User ID and Password for your database. For the sample database used in this example, use “DBA” and “SQL”.

    ODBC Configuration screen, Login tab with DBA typed in User ID box (Alt+u) and *** (hidden password) in password box.. Encrypt password  (Alt+e) is unchecked.
  6. Click the Database tab. If the data source is on a remote machine, type the server name and database file name. (The database file is used only if the database is not started automatically on server start-up.)

    508_alt_textODBC Configuration screen, Database tab with fionaw2k_asiqdemo typed in the Server name box (Alt+S). Start line (Alt+r) and Database name (Alt+n) are blank. Database file box (Alt+f) has C:—ycopies\asiqdemo.db. Encryption key (Alt+E) box is blank. Start database automatically (Alt+t) and Stop database after last disconnect (Alt+p) options are selected

    If the data source is on your local machine, type a start line and database name (without the .DB suffix) and skip to Step 8.

  7. If the data source is on a remote system, click the Network tab. Click the box for the appropriate protocol and specify the options beside the box. For example, to connect to server on system fionaw2k using TCP/IP protocol and port 1870, you would click TCP/IP and type host=fionaw2k:port=1870.

    ODBC Configuration screen, Network tab with TCP/IP option checked (Alt+T) and host-fionaw2k:1870 typed in its box. SPX (Alt+X) and Named pipes (Alt+p) options are unchecked. Shared memory (Alt+m) option is checked. Screen also lists timeout settings, a Compress network packets option, and encryption options for network packets

    You could also use the host network address. For example:

    host=157.133.66.75:1870
    

    NoteWhen specifying network connections, you need a different systemname:port# combination for each database server. The port number must match the one you use when you start the server.

  8. Click OK when you have finished defining your data source.

  9. The ODBC Data Source Administrator returns you to the User DSN tab.

NoteYou cannot connect to a Sybase IQ 12.7 server using an ODBC Data Source Name created for a 12.5 server, even if you specify the same server name, port number, and database name. Use the ODBC Data Source Administrator to remove DSNs created in 12.5 and add new DSNs.

You can use files as data sources instead of databases. File data sources are stored as files with the extension.dsn. For information about creating a file data source, see the Sybase IQ System Administration Guide.

StepsTesting an ODBC data source

  1. Start the database. (To start the Sample Database, use Start > Programs > Sybase > Adaptive Server IQ 12.7 > Start Sybase IQ Demo Database.)

  2. In the ODBC Data Source Administrator, select your new data source from the list of User Data Sources.

  3. Click Configure.

  4. On the ODBC Configuration dialog box, click Test Connection.

    If you cannot access the data source, check that you have filled out the various tabs with correct file and path names.