PRB: Compatibility Layer Error: Can't open any more tablesLast reviewed: June 21, 1995Article ID: Q116034 |
The information in this article applies to:
- Standard and Professional Editions of Microsoft Visual Basic for Windows, version 3.0
SYMPTOMSIf you have the Microsoft Jet 2.0/Visual Basic 3.0 Compatibility Layer installed on your computer, and you perform a transaction in which you open multiple tables, dynasets, or snapshots, you may encounter error 3014:
Can't open any more tables.This occurs after your transaction opens approximately three hundred tables, dynasets, or snapshots. The error occurs even if you explicitly close the tables, dynasets, or snapshots at some other point during the transaction.
CAUSEThis behavior is the result of a change to the Microsoft Access (Jet) database engine. In the Jet version 1.1 database engine, tables could be closed during a transaction. This resulted in unexpected behavior where closed tables would either be omitted from the transaction or cause an implicit RollBack. This problem was resolved in the Jet version 2.0 database engine by keeping table references open until the transaction finishes, so tables closed during the transaction can be maintained as part of the transaction without causing a RollBack. However, because table references are maintained, it is possible to exhaust the database engine's workspace if you open a large number of tables during the transaction.
RESOLUTIONOpen frequently used tables, dynasets, or snapshots outside the transaction.
STATUSThis behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
Code to Avoid the ErrorTo avoid the error, rewrite the code for the loop as:
Set ss = db.CreateSnapshot("SELECT * FROM Authors") For i = 1 To 500 Label1.Caption = i Label1.Refresh ' ' Code to manipulate the Snapshot records would be here ... ' Next i ss.Close Set ss = NothingBecause the snapshot is opened outside the loop, only one reference to the underlying tables is created, so the "Can't open any more tables" error does not occur.
|
Additional reference words: 3.00 errmsg
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |