BUG: CreateDynaset Holds Lock on Index if No Records Return (153018)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q153018 SYMPTOMS
After opening a Dynaset that contains no records with a SQL statement that
refers to an indexed field, attempting to access that table from another
application can cause the following error:
Couldn't save; currently locked by <User_Name> on machine <Machine_Name>
To work around this problem, add a call to the Idle method of the DBEngine
object immediately after the call to OpenRecordset. Add the following line
of code:
DBEngine.Idle dbFreeLocks
CAUSE
The error occurs because the Jet engine is not, by default, releasing the
lock on the index page after opening the Recordset. This behavior only
occurs when the Recordset returned contains no records. It occurs with Jet
2.5 and Jet 3.0, but doesn't occur with Jet 1.1.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Minor | Last Reviewed: | 3/2/2005 |
---|
Keywords: | kbbug kbDatabase kbpending KB153018 |
---|
|