FIX: Performance Decreases When the Source MDB File of Linked Access Table Is Open (293470)



The information in this article applies to:

  • ActiveX Data Objects (ADO) 1.0
  • ActiveX Data Objects (ADO) 2.1
  • ActiveX Data Objects (ADO) 2.1 SP1
  • ActiveX Data Objects (ADO) 2.1 SP2
  • ActiveX Data Objects (ADO) 2.5

This article was previously published under Q293470

SYMPTOMS

SELECT statements that are executed through ADO against a linked table in a Microsoft Access database return significantly slower when the Access file that acts as the source of the link is opened on another computer.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in Microsoft Data Access Components version 2.7.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new, empty Access 2000 database named Child.mdb.
  2. Open the Child.mdb file in Access, and add a linked table that connects to the Access Northwind sample database Customers table. For clarity, name the newly linked table "Linked_Customers".
  3. Create a new Visual Basic 6.0 project. Form1 is created by default.
  4. Add a reference to Microsoft ActiveX Data Objects 2.x.
  5. Add a command button (cmdTest) to Form1.
  6. Add the following code to the cmdTest_Click() event of Form1:
    Dim adoRS As ADODB.Recordset
    Dim sngTM As Single
    Dim adoCN As New ADODB.Connection
    
    adoCN.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
       	 "Data Source=<full path and file name for Child.mdb"
    Set adoRS = New ADODB.Recordset
    sngTM = Timer
    adoRS.Open "SELECT * FROM LINKED_CUSTOMERS", _
        	adoCN, adOpenForwardOnly, adLockReadOnly, adCmdText
    adoRS.MoveFirst
    MsgBox "Elapsed Time = " & Timer - sngTM
    adoRS.Close
    Set adoRS = Nothing
    adoCN.Close
    Set adoCN = Nothing
    					
  7. Change the Data Source property of the connection string to the Child.mdb path.
  8. Run the Visual Basic project, and click the command button to execute the code. Note the elapsed time.
  9. On a second workstation that has the appropriate version of Access installed, open the Northwind sample database.
  10. Click the command button again on the default form of the Visual Basic project that is running on the first workstation. Notice that the elapsed time is significantly greater than it was the first time.
  11. Close the instance of the Northwind sample database that is running on the second workstation.
  12. Stop the execution of the Visual Basic project that is running on the first workstation.
  13. Change the connection string in the sample code as follows:
    "Driver={Microsoft Access Driver (*.mdb)};" & _
            "DBQ=Child.mdb;DefaultDIR=<path to Child.mdb>"
    					
  14. Repeat steps 8 through 10. You may notice similar behavior with this second connection string that uses the ODBC Driver. However, the performance decrease is slightly less than that observed with the OLE DB connection string.

Modification Type:MinorLast Reviewed:7/28/2003
Keywords:kbbug kbClient kbfix kbJET kbmdac270fix kbMDACNoSweep KB293470