Article ID: 305388 - View products that this article applies to.
This article was previously published under Q305388
Advanced: Requires expert coding, interoperability, and multiuser skills.
This article applies only to a Microsoft Access project (.adp).
When you try to pass a valid UDL file as the BaseConnectionString argument of the CurrentProject.OpenConnection method in an Access project (ADP), you receive no error message, but the ADP file is not connected.
The BaseConnectionString argument of the OpenConnection method does not accept UDL files.
To work around this behavior, use the UDL file to open an ADO connection, and then pass the connection string information of the newly opened connection object as the BaseConnectionString argument of the CurrentProject.OpenConnection method. For an example of how to do so, follow these steps:
UDL files are text files that have connection information for OLE DB data sources, much in the same way that DSN files have connection information for ODBC data sources. If applications use a common UDL file to get connection settings, changing the connection settings of the UDL file can then affect any applications that rely on it. For example, UDL files can be useful for redirecting ADP files to a backup server when the main server is offline.
For additional information about how to create UDL files and to use them to create connections using ADO, click the following article numbers to view the articles in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/189680/ )How To Use Data Link Files with ADO
300261Although the OpenConnection method of the current project is similar to the ADO Open method, the two are not exactly the same. In this case, although specifying a UDL file in the Open method of an ADO Connection object works, it does not work in the OpenConnection method.
(http://support.microsoft.com/kb/300261/ )How To Create an ADO Connection from a Data Link File in Data Access Components
For additional information about using the OpenConnection method , click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/306881/ )How to programmatically change the connection of a Microsoft Access project
Steps to Reproduce the Behavior