A machine data source name (DSN) stores information about a data connection in the Windows® Registry of the computer on which the DSN was created.
Note The information stored in the registry is the same information that is stored in a file DSN. However, you cannot use a machine DSN to create a DSN-less connection as you can a file DSN. For more information about the DSN-less connection, see Creating a File DSN.
In a file DSN, connection information is stored in the Global.asa file. In a machine DSN, the Global.asa file contains a pointer to the information stored in the Windows Registry. Therefore, every computer that uses the project (including the Web server) must have the connection information in exactly the same Registry address. This makes a machine DSN less portable than a file DSN.
However, if you use a machine DSN during development, it is easy to change the database you are working with simply by changing the entry in the Windows Registry; you do not have to change the Global.asa file each time. In addition, machine DSNs are useful if you need to use the same DSN in many different applications on your computer.
To create a new machine DSN
Note In Microsoft® Visual C++®, right-click the database project in FileView.
For SQL Server data sources, you use the Create a New Data Source wizard. For other data sources, you use various dialog boxes. For example, for Microsoft® Access data sources, you use the ODBC Microsoft Access 97 Setup dialog box, and for Microsoft® FoxPro® data sources, you use the ODBC Visual FoxPro Setup dialog box.
Note When you specify a database, enter a location that will work not only in the development environment you are using, but also in your final project. For example, if your project involves a database that is accessed from a Web server, use a Universal Naming Code (UNC) to be sure that the database location you specify is accessible from the Web server.
If you've created a machine DSN for a server-based database, you will be prompted with the login dialog box for the database server. You will be prompted again each time you connect to the database using the DSN.