Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

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 (http://www.microsoft.com/technet/security/prodtech/IIS.mspx)

↑ Back to the top


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.

↑ Back to the top


More information

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.
1.Start the UDL Wizard:
a. Right-click your desktop and select New, and then Text Document.
b. Rename the new text document as My.udl. Press ENTER.
c. 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.

2.Next, double-click My.udl and use the Wizard as follows:
a. Click the Provider tab.
b. From the Providers menu, select Microsoft Jet 4.0 OLE DB Provider, and then click Next to proceed to the Connections tab.
3.On the Connections tab:
a. Type your database name or browse to the database you want to connect to.
b. 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 "Additional Information," later in this article, to configure the System database.
c. Click ok, which will close the Wizard.
4.Next, right-click My.udl file and rename it as My.txt. Click yes in the warning dialog box that appears.
5.Double-click My.txt, and a statement similar to the following will appear:
[oledb]
; Everything after this line is an OLE DB initstring
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\My.mdb;User ID=;Password=;
						
The following line is the connection string from My.txt:
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("ADODB.Connection")
strCXN = "Microsoft.Jet.OLEDB.4.0;Data Source=C:\My.mdb;User ID=;Password=;"
objCXN.Open strCXN
   .
   .
   .
objCXN.Close
Set objCXN = Nothing
				
Note Do not use �objCXN.Open("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:
1.Click the All tab.
2.Select the field labeled Jet OLEDB.System database.
3.Click Edit Value.
4.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
5.Click OK in the Edit Property Value window.
6.Select the field labeled Jet OLEDB:Database Password.
7.Click Edit Value.
8.In the Property Value box, type the password for the System database.
9.Click OK in the Edit Property Value window.
10.Click OK to close the Data Link Properties window.
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
				

↑ Back to the top


References

For more information, click the following article number to view the article in the Microsoft Knowledge Base:
299974 Using Microsoft Jet with IIS
222135 Using Microsoft Jet with IIS
299973 Using Microsoft Jet with IIS
Although Microsoft does not recommend that you use Internet Information Server (IIS) to connect to Access databases, there are several advantages to using OLE DB versus ODBC for Access database connections. One of the benefits of using OLE DB connections is the ability to connect to databases without the need to create a user or system DSN on the Web server. Other advantages include the ability to call a thread-safe version of Visual Basic for Applications, and increased stability.

For more information about MDAC, visit the following Microsoft Developer Network (MSDN) Web site: The Downloads section lists the versions of MDAC that are available. Be sure to read the details prior to installing a new version to make sure that the new version will work correctly with your Web applications and configurations.

For more information about how to improve Web server performance, visit the following MSDN Web site:

↑ Back to the top


Keywords: KB264691, kbinfo

↑ Back to the top

Article Info
Article ID : 264691
Revision : 11
Created on : 3/29/2007
Published on : 3/29/2007
Exists online : False
Views : 602