BUG: LDB File Grows When using ADO to Access 97 MDB Hosted on Novell

ID: Q236101


The information in this article applies to:
  • ActiveX Data Objects (ADO), versions 2.0, 2.1, 2.1 SP2
  • Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, version 6.0


SYMPTOMS

Using ADO to connect to a Microsoft Access 97 database hosted on a Novell 3.x, 4.x, or 5.x Server, you may see the .ldb file grow ("bloat").

  • The bloat may occur even though the number of users are not increasing.


  • The bloat occurs with both the Jet OLE DB Providers 3.51 and 4.0 and with the ODBC Provider with the Microsoft Access ODBC Driver.


  • The bloat does not occur if the Microsoft Access 97 database is hosted on a Windows NT network.


The .ldb file grows until the maximum number of Jet database users, 255, are listed in the .ldb file. Once the maximum number of users is exceeded, you receive a run-time error. You may see the following error:
Too many active users.
You may see the following error, using the ODBC Provider:
Run-time error '-2147467259(80004005)' [Microsoft][ODBC Microsoft Access Driver]Cannot open database '(unknown)'. It may not be a database that your application recognizes, or the file may be corrupt.


CAUSE

The file grows because the locks are not being released.


RESOLUTION

Some possible workarounds include:

  • Upgrade the Microsoft Access 97 database to a Microsoft Access 2000 database.


  • Host the Microsoft Access 97 database on a Windows NT network.


  • Try eliminating global connections.


  • Use DAO instead of ADO.



STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

In the following example, a global connection to a Microsoft Access 97 .mdb file is established in the Form Load event. In addition, a new connection is opened, closed, and destroyed every second.

Steps to Reproduce Behavior

  1. Copy the Microsoft Access 97 Nwind.mdb database that comes with Visual Basic 6.0 to a shared folder on a Novell server.


  2. Configure a System data source name (DSN) named Test that uses the Microsoft Access Driver (*.mdb) to connect to the Nwind.mdb on the Novell server.


  3. In Visual Basic 6.0, create a new Standard EXE project. Form1 is created by default.


  4. Add a reference to ADO 2.1. From the Project menu, click References and then select the Microsoft ActiveX Data Objects 2.1 Library.


  5. Add a Timer control to Form1. Timer1 is created by default.


  6. Set the Interval property of Timer1 to 1000 (1 second).


  7. Paste the following code into Form1's Code Window:


  8. 
    Dim cnGlobal As New ADODB.Connection
    Private Sub Form_Load( )
    ' This connection remains open for the life of the app
      cnGlobal.Open "Data Source=Test"
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
    ' Close the lifetime connection
      cnGlobal.Close
      Set cnGlobal = Nothing
    End Sub
    
    Private Sub Timer1_Timer( )
    'Create and destroy the temporary connection every second
      Dim cnTemp As New ADODB.Connection
      cnTemp.Open "Data Source=Test"
      cnTemp.Close
      Set cnTemp = Nothing
    End Sub  
  9. Execute the code. In a few minutes, you may see the following error:


  10. Run-time error '-2147467259(80004005)' [Microsoft][ODBC Microsoft Access Driver]Cannot open database '(unknown)'. It may not be a database that your application recognizes, or the file may be corrupt.
  11. While the program is running, examine the Nwind.ldb database locking file that is created in the same folder as the .mdb file. You may either open the Nwind.ldb file using Notepad, or examine the Nwind.ldb file in detail using the LDBView utility. Examining the .ldb file allows you to see the number of database connections growing.



REFERENCES

For more information about .ldb files and to obtain the LDBView utility, please see the following article in the Microsoft Knowledge Base:

Q176670 Microsoft Jet Utilities Available on MSL

Additional query words:


Keywords          : kbADO kbDatabase kbOLEDB210bug kbVBp kbNovell kbGrpVBDB kbGrpMDAC kbDSupport kbMDAC210SP2bug 
Version           : WINDOWS:2.0,2.1,2.1 SP2,6.0
Platform          : WINDOWS 
Issue type        : kbbug 


Last Reviewed: September 22, 1999
© 1999 Microsoft Corporation. All rights reserved. Terms of Use.