Using file data sources

On Windows operating systems, ODBC data sources are typically stored in the system registry. File data sources are an alternative, which are stored as files. File data sources are supported on both Windows and UNIX systems.

In Windows, file data sources typically have the extension .dsn. They consist of sections, each section starting with a name enclosed in square brackets. DSN files are very similar in layout to initialization files.

To connect using a File Data Source, use the FileDSN connection parameter. You cannot use both DSN and FileDSN in the same connection.

File data sources can be distributed

One benefit of file data sources is that you can distribute the file to users, so that connection information does not have to be reconstructed on each machine. If the file is placed in the default location for file data sources, it is picked up automatically by ODBC. In this way, managing connections for many users can be made simpler.

NoteBecause DSNs are stored in the Windows registry, they are public information. For this reason you should not put a password in a DSN, unless you encrypt it. If you want to store your password in your data source, use a File DSN.

Embedded SQL applications can also use ODBC file data sources.

Creating a file data source using the ODBC Administrator

StepsCreating an ODBC file data source (ODBC Administrator)

  1. Start the ODBC Administrator, click the File DSN tab and click Add.

  2. Select Sybase IQ 12 from the list of drivers, and click Next.

  3. Follow the instructions to create the data source.

Creating a file data source using a text editor

A file data source is a text file, so it can be edited using any text editor. One limitation to using a text editor is that you cannot store encrypted passwords in the file.

Example of a file data source

[Sample File Data Source]    
 ENG = iqdemo    
 DBA = DBA 
 PWD = sql