ODBC (Open Database Connectivity)

Long name ODBC
Short name ODBC
File extension(s) .odbc

ODBC technology is a standard programming language interface used to connect to a variety of data sources like Microsoft Access, Oracle, etc. This is usually accessed through Control Panel, where data source names can be assigned to use specific ODBC drivers.

Data Source Name (DSN)

An ODBC term for the collection of information used to connect your application to a particular data source (database application). The ODBC Driver Manager uses this information to create a connection to the database. A DSN can be stored in a file (a file DSN) or in the Windows' Registry (a machine DSN).

Choose a DSN from CATALYST Professional

To access a DSN through CATALYST Professional, first select from the File menu the Open option. Then, from the File Selector window press the Remote Data button. Finally, from the Driver list box of the Remote Data window select the ODBC option. Following this selection, you must choose a DSN from the Select Data Source window to connect to a database within a database. That's it.

Difference between File and Machine DSNs

A DSN stores information about how to connect to a particular database. The ODBC driver manager uses the information in the DSN to establish and manage the connection.

There are two types of DSNs. Both types store information needed to make a connection to a database server, but they store it in different locations. The two types are:

File DSN Connection

File DSN Connection information is stored in a file that can be read by any a feature which makes the project more easily portable between computers. As a general rule, you should always use file DSNs.

Machine DSN Connection

Machine DSN Connection information is stored in the Windows' Registry of the computer on which the data connection is created.

You can choose either a file DSN or a machine DSN from the Select Data Source window, which opens when you choose to create a new data connection. You can also either select an existing data source name or create a new one.

In order to connect to a particular database server, you must have an ODBC driver for that database server. If the ODBC driver you need doesn't appear in the ODBC Data Source Administrator window, you might not have the correct ODBC driver installed on your computer. Check your database's documentation to determine whether there's an ODBC driver available for it.

If you're developing a client-server application, you can use either a file DSN or a machine DSN to add a data connection. When you build the setup program for your application using the setup wizard, you must set up a machine DSN on the user's computer. You do this by modifying the user's registry to contain the information needed to make the connection.

A file DSN stores information about a database connection in a file. The file has the extension .dsn and by default is stored in the $\Program Files\Common Files\ODBC\Data Sources directory.

Create a new file DSN

To create a new file DSN follow the following steps:

  1. Open the ODBC Data Source Administrator window:
    • Go to the Start Menu
    • Choose Settings
    • Choose Control Panel
    • Select the ODBC icon
  2. . Select the File DSN tab.
  3. Choose Add.
  4. Select the driver for which you want to set up a data source, and then choose Next.
  5. Type a name for the file that will contain the connection information. Once created, this name will appear in the Select Data Source window. The extension .dsn is automatically appended to the name that you type. When you have finished typing the name, choose Next.
    • Review the information you have entered. If everything is correct, choose Finish. If you want to make changes, choose Back.
    • Follow the instructions for the Create a New Data Source wizard or the window that is displayed. For help with these windowes, choose the Help button.

If you've created a file DSN for a server-based database (like Oracle), you will be prompted with the login window for the database server. The values you enter into the login window are used to build the connection string stored in the file DSN. If you specify a password in the login window, you will be prompted for the password every time you log on to the database. If the account you use to log on to the database doesn't have a password, you won't be prompted for a password when you log on again.

© PCI Geomatics Enterprises, Inc.®, 2023. All rights reserved.