Table Of Contents

Connecting to a Database Using Data Source Names

Last Modified: November 20, 2020

Establish a connection with a database using Open Database Connectivity (ODBC) protocols.

  1. Use the ODBC Data Source Administrator dialog box to register and configure drivers to make them available as data sources. In the Windows Control Panel, select Administrative Tools»ODBC Data Sources to configure a data source name connection.
  2. Place an Open Connection node in your code.
  3. Use a string or a path to specify the DSN you created, and wire it to the connection information input.
If you experience problems connecting to a database after configuring your DSN, try the following troubleshooting strategies:
  • Verify the requested server is running.
  • Verify the network is running.
  • Verify there are available server connections.
  • Verify with your administrator whether the maximum number of user licenses has been reached.
  • Check whether you have permission to access the specified database.
  • Check whether the specified DSN exists.
  • Select the correct provider for a database. You must create a DSN to connect to a database that uses ODBC, while you must use a UDL to connect to databases that use ADO and OLE DB.

You can use any ODBC-compliant driver with the Database Connectivity API.

Recently Viewed Topics