FIX: Incorrect VB Error When Delete Index on Open TableLast reviewed: October 30, 1997Article ID: Q107363 |
3.00
WINDOWS
kbprg kbbuglist
The information in this article applies to: - Professional Edition of Microsoft Visual Basic for Windows, version 3.0
SYMPTOMSIf you attempt to delete an index on an open table, you correctly get an error but the message is incorrect. The program example given in the More Information section gives the following incorrect error when attempting to delete an index from an open Microsoft Access table:
ODBC-call failed.This message is misleading because the program uses no ODBC. This is error number 3146, returned by the Err function.
CAUSEThe ODBC-call failed message is incorrect. The message should instead say the table is currently open and cannot be locked. You cannot delete an index from a table if the table is Open. This is behavior is by design. You must be able to lock the table before you can delete an index. You cannot lock the table if the table is open by anyone.
WORKAROUNDClose the table before deleting an index. You may also need to use the Refresh method on the TableDefs collection before using the Delete method.
STATUSRegarding the incorrect error message, Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem has been corrected in Visual Basic version 4.0. All other behavior described in this article is by design.
MORE INFORMATION
Steps to Reproduce Behavior
To work around the problem, close the table before doing the Delete method. NOTE: If the first data definition language (DDL) operation is a Delete method, the Delete will fail with the error, "Name not found in this collection." This is a separate bug and is explained in another article in the Microsoft Knowledge Base. To work around this bug, execute the db.TableDefs.Refresh method before attempting a Delete.
|
Additional reference words: buglist3.00 3.00 erase remove how-to create
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |