Microsoft KB Archive/891176

= Slower performance in Access-based or Jet database-based programs after you upgrade from Windows NT 4.0 to Windows 2000 or to Windows XP =

Article ID: 891176

Article Last Modified on 12/1/2007

-

APPLIES TO

 Microsoft Office Access 2007 Microsoft Office Access 2003 Microsoft Access 2002 Standard Edition Microsoft Access 2000 Standard Edition Microsoft Access 97 Standard Edition, when used with:  Microsoft Windows 2000 Professional Edition

 Microsoft Windows XP Professional x64 Edition</li></ul>

 Microsoft Windows XP Professional</li></ul>

 Microsoft Windows XP Tablet PC Edition</li></ul> </li></ul>

-

<div class="symptoms_section">

SYMPTOMS
After you upgrade your computer from Microsoft Windows NT 4.0 to Microsoft Windows 2000 or to Microsoft Windows XP Professional, you may experience slower performance in Microsoft Access-based or Jet database-based programs.

<div class="cause_section">

CAUSE
This issue may occur if one or more of the following conditions are true:  You are working with a split database, and the backend database file resides in a folder that has a name that is longer than 8 characters. For example, the backend database file resides in a folder that has a name that is similar to the following:

BigFolderName

</li> You are working with a split database, and the name of the backend database file is longer than 8 characters excluding the three-character .mdb file name extension. For example, the backend database file has a name that is similar to the following:

BigDatabaseFileName.mdb

</li> You are working with a database that is not split, and the name of the database file does not follow the 8.3 naming convention. Or the database is stored in a folder that has a long name.</li></ul>

The caching design of the Workstation service in Windows 2000 and in later versions of Windows is different from the caching design of the Workstation service in earlier versions of Windows.

In Windows 2000 and in later versions of Windows, the caching design of the Workstation service has been changed to favor database integrity in a multi-user environment. This design change causes a delay when Jet makes API calls to retrieve information about the long folder name or about the long file name. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

889588 How to optimize Office Access and Jet database engine network performance with Windows 2000-based and Windows XP-based clients

<div class="resolution_section">

RESOLUTION
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.

If you are working with a split database, you can resolve this issue by relinking your existing Jet tables. To do this, create code to send a short representation of the long folder name to the Windows API. This resolution requires your backend database to have a file name that follows the 8.3 naming convention. To create this code, follow these steps in the front-end database: <ol> Set a reference to Microsoft ADO Ext 2.5 (or to a later version of ADO).</li>  Add the following code to a new module. Declare Function GetShortPathName Lib &quot;kernel32&quot; _ Alias &quot;GetShortPathNameA&quot; (ByVal lpszLongPath As String, _          ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long

Function RefreshLinks On Error GoTo ErrorHandler 'Define the ADOX Catalog object. Dim objCat As New ADOX.Catalog 'Define the ADOX Table object. Dim objTbl As ADOX.Table

'Database name of the linked table. Dim strFilename As String 'Path and database name of the linked table. Dim strFullName As String

Dim blnIsMapi As Boolean Dim blnIsImex As Boolean Dim blnIsTemp As Boolean Dim blnLongFileName As Boolean Dim blnFailedLink As Boolean Const srtImex = &quot;IMEX&quot; Const strMapi = &quot;MAPILEVEL=&quot;

'Open the catalog. objCat.ActiveConnection = CurrentProject.Connection

'Loop through the table collection and update the linked tables. For Each objTbl In objCat.Tables 'Verify that the table is a linked table. If objTbl.Type = &quot;LINK&quot; = True Then blnIsTemp = objTbl.Properties(&quot;Temporary Table&quot;) Or Left(objTbl.Name, 1) = &quot;~&quot; blnIsImex = (InStr(1, objTbl.Properties(&quot;Jet OLEDB:Link Provider String&quot;), srtImex, vbTextCompare) > 0) blnIsMapi = (InStr(1, objTbl.Properties(&quot;Jet OLEDB:Link Provider String&quot;), strMapi, vbTextCompare) > 0)

If Not blnIsTemp And Not blnIsImex And Not blnIsMapi Then 'Verify that the table is a Jet table. strFullName = objTbl.Properties(&quot;Jet OLEDB:Link Datasource&quot;) strFilename = Mid(strFullName, InStrRev(strFullName, &quot;\&quot;, _ Len(strFullName)) + 1, Len(strFullName)) 'Determine whether the database exists. If DoesFileExist(strFullName) = True Then objTbl.Properties(&quot;Jet OLEDB:Link Datasource&quot;) = GetShortName(strFullName) 'Update the link by using the short path name. Else MsgBox &quot;Cannot update: '&quot; & objTbl.Name & &quot;'&quot; & String(2, vbCrLf) & &quot;File not found: &quot; & vbCrLf & strFullName blnFailedLink = True End If               If InStr(strFilename, &quot;.&quot;) > 9 Then blnLongFileName = True End If       End If    Next If blnFailedLink = False Then If blnLongFileName = True Then MsgBox &quot;The table links were successfully updated, but the name of the backend database file does not follow 8.3&quot; & _ vbCrLf & &quot;Please rename the file, relink the tables, and then run the procedure again.&quot;, vbExclamation Else MsgBox &quot;The links were successfully updated!!! &quot;, vbInformation End If   Else MsgBox &quot;The links were not successfully updated.&quot; & vbCrLf & &quot;Please verify you table links.&quot;, vbExclamation End If

ExitHandler: Exit Function

ErrorHandler: MsgBox Err.Description & &quot; &quot; & Err.Number Resume ExitHandler End Function Function GetShortName(ByVal sLongFileName As String) As String Dim lRetVal As Long, sShortPathName As String, iLen As Integer 'Set up a buffer area for the API function call return. sShortPathName = Space(255) iLen = Len(sShortPathName) 'Call the function. lRetVal = GetShortPathName(sLongFileName, sShortPathName, iLen) 'Remove unwanted characters. GetShortName = Left(sShortPathName, lRetVal) End Function

Function DoesFileExist(strFileSpec As String) As Boolean 'Return True if the file that is specified in the 'strFilespec argument exists. 'Return False if strFileSpec is not a valid 'file or if strFileSpec is a directory. Const INVALID_ARGUMENT As Long = 53 On Error GoTo DoesfileExist_Err If (GetAttr(strFileSpec) And vbDirectory) <> vbDirectory Then DoesFileExist = CBool(Len(Dir(strFileSpec)) > 0) Else DoesFileExist = False End If DoesfileExist_End: Exit Function DoesfileExist_Err: DoesFileExist = False Resume DoesfileExist_End End Function </li> Run the RefreshLinks function. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> In Visual Basic Editor, click Immediate Window on the View menu.</li> In the Immediate window, type RefreshLinks. Then, press ENTER.</li></ol> </li></ol>

The RefreshLinks function loops though the linked Jet tables in a database and verifies whether the link is valid. If the link is valid, this code uses the Windows API function GetShortPathName to create a short name that follows the 8.3 naming convention. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

142982 How Windows generates 8.3 file names from long file names

This code then updates the link by using a path that includes the new short name. If the link points to a backend database file that does not follow the 8.3 naming convention, this code generates a message to suggest that you rename the backend database file.

<div class="status_section">

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.

Note If you use Windows XP, you may improve performance by applying Microsoft Windows XP Service Pack 2 (SP2).

<div class="moreinformation_section">

MORE INFORMATION
For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:

209862 How to relink backend tables with the common dialog control in Access 2000

175512 How to get a short file name from a long file name

Additional query words: ACC2007 Acc2002 Acc2003 Microsoft Access XP Jet NT4 NT4.0 Win2000 WinXP

Keywords: kbhowto kbinfo kbtshoot kbfilesystems kbenv KB891176

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.