Microsoft KB Archive/236101

= PRB: LDB File Grows When You Use ADO to Access 97 MDB Hosted on Novell =

Article ID: 236101

Article Last Modified on 5/8/2003

-

APPLIES TO


 * Microsoft ActiveX Data Objects 2.0
 * Microsoft ActiveX Data Objects 2.1
 * Microsoft ActiveX Data Objects 2.1 Service Pack 2
 * Microsoft ActiveX Data Objects 2.5
 * Microsoft ActiveX Data Objects 2.6
 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q236101



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. The locks are not released because Novell clients handle multiple file opens differently than Microsoft clients.



RESOLUTION
Novell has re-engineered the Novell client to issue the unlocked NetWare Core Protocol (NCP) before closing a multiple opened file. The change is available in the Novell 3.2 client. In addition, an updated client32.nlm (10/7/1999 or later) can be obtained from Novell Technical Support.

To obtain the updated client32.nlm, connect to Novell Technical Support and search for the article at:

http://www.support.novell.com



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
 Copy the Microsoft Access 97 Nwind.mdb database that comes with Visual Basic 6.0 to a shared folder on a Novell server. 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. In Visual Basic 6.0, create a new Standard EXE project. Form1 is created by default. Add a reference to ADO 2.1. From the Project menu, click References and then select the Microsoft ActiveX Data Objects 2.1 Library. Add a Timer control to Form1. Timer1 is created by default. Set the Interval property of Timer1 to 1000 (1 second).</li>  Paste the following code into Form1's Code Window: 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 </li> Execute the code. In a few minutes, you may see the following error:

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.

</li> 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.</li></ol>

<div class="references_section">