Microsoft KB Archive/264691

= Create a connection string for an Access 97 database or an Access 2000 database by using a Universal Data Link Wizard =

Article ID: 264691

Article Last Modified on 3/29/2007

-

APPLIES TO


 * Microsoft Internet Information Server 4.0
 * Microsoft Internet Information Services 5.0
 * Microsoft Access 2000 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q264691



We strongly recommend that all users upgrade to Microsoft Internet Information Services (IIS) version 6.0 running on Microsoft Windows Server 2003. IIS 6.0 significantly increases Web infrastructure security. For more information about IIS security-related topics, visit the following Microsoft Web site:

http://www.microsoft.com/technet/security/prodtech/IIS.mspx



SUMMARY
Microsoft provides a wizard interface for users of Microsoft Data Access Components (MDAC) 2.0, and later versions, to create OLE DB connection strings for Microsoft Access 97 and Access 2000 databases. This article describes how to set up and use this Universal Data Link (UDL) Wizard.



Using the UDL Wizard to create an OLE DB connection string
Note If you add a user ID and a password in an ASP file, anyone who has access to the source file on the server can read this information. Therefore, you may want to take the following additional precautions:  Use Microsoft Windows Integrated authentication to Microsoft SQL server when applicable. Create the connection string in a .dll file, and then call the .dll file from your ASP page. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

271284 How to access the COM+ object constructor string in a Visual Basic component

 Keep the system updated by applying all security updates, and hotfixes. Make sure that your server that is running Microsoft Internet Information Services (IIS) or Internet Information Server (IIS) is secure to reduce the risk that any users other than administrators can view the source of the ASP file.

 Start the UDL Wizard: <ol style="list-style-type: lower-alpha;"> Right-click your desktop and select New, and then Text Document.</li> Rename the new text document as My.udl. Press ENTER.</li> You will receive a warning about renaming the file extension. Click yes. Note that the file's icon now looks like a computer with a datasheet in the background.

</li></ol> </li> Next, double-click My.udl and use the Wizard as follows: <ol style="list-style-type: lower-alpha;"> Click the Provider tab.</li> From the Providers menu, select Microsoft Jet 4.0 OLE DB Provider, and then click Next to proceed to the Connections tab.</li></ol> </li> On the Connections tab: <ol style="list-style-type: lower-alpha;"> Type your database name or browse to the database you want to connect to.</li> If you have created an account to use for Internet connections to the database, enter those credentials. Otherwise, you can use the default settings (Admin, no password). (To use the default settings, enter Admin as the user name, and then select the Blank Password checkbox). If you do not want to use the default credentials, follow the steps under &quot;Additional Information,&quot; later in this article, to configure the System database.</li> Click ok, which will close the Wizard.</li></ol> </li> Next, right-click My.udl file and rename it as My.txt. Click yes in the warning dialog box that appears.</li> Double-click My.txt, and a statement similar to the following will appear:

<pre class="fixed_text">[oledb] Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\My.mdb;User ID=;Password=;
 * Everything after this line is an OLE DB initstring

</li></ol>

The following line is the connection string from My.txt:

<pre class="fixed_text">Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\My.mdb;User ID=;Password=;

The following sample code illustrates how this connection string can be incorporated into an ASP page: Set objCXN = Server.CreateObject(&quot;ADODB.Connection&quot;) strCXN = &quot;Microsoft.Jet.OLEDB.4.0;Data Source=C:\My.mdb;User ID=;Password=;&quot; objCXN.Open strCXN .  .   . objCXN.Close Set objCXN = Nothing Note Do not use “objCXN.Open(&quot;DSN=...)”, because you are no longer using a DSN connection.

Additional Information
If you are specifying an Access database username and password, use the following steps to specify the path and the password to access the SYSTEM.mdw file.

In the UDL Wizard: <ol> Click the All tab.</li> Select the field labeled Jet OLEDB.System database.</li> Click Edit Value.</li> In the Property Value box, type the path to the SYSTEM.mdw file:

Windows NT 4: C:\winnt\system32\System.mdw

Windows 2000: C:\Program Files\Common Files\System\System.mdw

</li> <li>Click OK in the Edit Property Value window.</li> <li>Select the field labeled Jet OLEDB:Database Password.</li> <li>Click Edit Value.</li> <li>In the Property Value box, type the password for the System database.</li> <li>Click OK in the Edit Property Value window.</li> <li>Click OK to close the Data Link Properties window.</li></ol>

The final Connection String should look like this: Provider=Microsoft.Jet.OLEDB.4.0;Password=joe;User ID=jim;Data Source=C:\My.mdb;Persist Security Info=True;Jet OLEDB:System database=C:\Program Files\Common Files\System\SYSTEM.MDW;Jet OLEDB:Database Password=14323

<div class="references_section">