BUG: You receive an "Bad File Name or Number" error message when you upsize databases with Data Access Pages stored on server (282380)
The information in this article applies to:
This article was previously published under Q282380 Moderate: Requires basic macro, coding, and interoperability
skills.
This article applies only to a Microsoft Access database (.mdb).
SYMPTOMS When you use the Upsizing Wizard to convert a Microsoft
Access database that contains data access pages to an Access project, you may
receive the following error message:
UT_HandleADPDataPages Bad file name or number 52 CAUSE This behavior can occur because the data access pages are
linked by using a Web server path such as http://, ftp://, or https://. The
Upsizing Wizard does not properly handle these paths when it creates the new
project. RESOLUTION To work around this issue, use one of the following
methods. Method 1: Re-create Links Re-create the links to the existing data access pages after the
new Access project has been created. Method 2: Use VBA Code Use Microsoft Visual Basic for Applications (VBA) code to
re-create pages whose links are not copied correctly by the Upsizing
Wizard. NOTE: This code will modify existing data access pages. It is
recommended that you create backups of your pages before running this
code. To relink the pages using VBA code, follow these
steps: Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. - Click the Modules object in the newly created Access project, and then click New.
- Type or paste the following code in the Visual Basic
Editor:
Sub RelinkDataPages(strPathToMDBFile As String)
' Automates Access to create a new data access page in the
' project file (.adp) from the links in the database (.mdb) file
Dim ao As AccessObject
Dim dp As DataAccessPage
Dim objAccApp As Access.Application
Set objAccApp = New Access.Application
With objAccApp
' open the original MDB file
.OpenCurrentDatabase strPathToMDBFile
For Each ao In .CurrentProject.AllDataAccessPages
' Create the new path with the link from the existing page
Set dp = Application.CreateDataAccessPage(ao.FullName, False)
' Modify the connection of the page to match the ADP's connection info.
' Using the .Connection or .AccessConnection property includes the
' Microsoft.Access.OLEDB.10.0 provider and will not work in the connection
' string of a data access page. As a result, use the .BaseConnectionString
' property instead to get the basic information.
' If you are using SQL Server security, you will need to
' to concatenate the user name and password information
' for the page.
dp.MSODSC.ConnectionString = CurrentProject.BaseConnectionString
' save the new page
DoCmd.Save acDataAccessPage, dp.Name
' close the page
DoCmd.Close acDataAccessPage, dp.Name
Next
End With
' cleanup
Set ao = Nothing
objAccApp.Quit
Set objAccApp = Nothing
MsgBox "Pages have been relinked"
End Sub
- Save the module as
FixLinks.
- Type the following line in the Immediate window and press
ENTER
RelinkDataPages "<FullPathToDatabase>"
where <FullPathToDatabase> is the path to the database that you
just upsized.
STATUSMicrosoft
has confirmed that this is a problem in the Microsoft products that are listed
at the beginning of this article.
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kbwizard kbDAP kbtshoot kbbug kberrmsg kbnofix KB282380 |
---|
|