Sybase 12.4.2 manual Creating and editing Odbc data sources

Models: 12.4.2

1 536
Download 536 pages 20.34 Kb
Page 85
Image 85

CHAPTER 2 Running Adaptive Server IQ

Examples of connection strings using data sources

To create or edit DSNs or File DSNs on UNIX systems, use a text editor. For DSNs you can edit the .odbc.ini file directly. For File DSNs, create a file with the name you choose, using the file extension .dsn.

Note Sybase recommends that, to avoid ambiguity, you be as specific as possible in creating ODBC and other data sources, whether you create them using the ODBC Administrator, or by editing odbc.ini, .odbc.ini, or .dsn files directly. If more than one database is started on a server, for example, you should specify the database name, and in a network with subnets, specify the CommLinks parameter including the host number when editing files; include the host number in the network protocol options on the Network tab in the ODBC Administrator.

If connection parameters are incomplete or incorrect, you may see an error such as

Database name required to start engine

For a complete list of connection parameters, see Chapter 3, “Connection and Communication Parameters” in Adaptive Server IQ Reference Manual.

The following connection string specifies an ODBC Data Source Name and a user ID.

DSN=ASIQ sample;uid=DBA

The following connection string specifies a File Data Source Name, with a user

ID and password.

FILEDSN=ASIQ on UNIX;uid=DBA;pwd=SQL

Creating and editing ODBC data sources

You need an ODBC data source on the client computer for each database you wish to connect to. You probably already have an odbc.ini file on your system.

On Windows NT, the ODBC Administrator provides a central place for managing ODBC data sources. The following procedure uses the ODBC Administrator to add a new data source to your existing odbc.ini, or creates a new file if necessary.

To create ODBC data sources on UNIX systems, see also “Using ODBC data sources on UNIX”.

65

Page 85
Image 85
Sybase 12.4.2 manual Creating and editing Odbc data sources