Choosing a Data Source Name

You must choose a data source name (DSN) to connect to a database within a database project or a Web project. A DSN stores information about how to connect to a particular ODBC 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:

You can choose either a file DSN or a machine DSN from the Select Data Source dialog box, 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. If you click the New button to create a new DSN, the Create New Data Source wizard opens to assist you.

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 Create New Data Source wizard, 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 in Microsoft® Visual C++®, or Microsoft® Visual J++™, 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.