PRB: CLEAR ALL Removes Back-Links from Data Environment ObjectID: Q142394 3.00 3.00b WINDOWS kbprg kbprb The information in this article applies to:
SYMPTOMSIf the CLEAR ALL command is issued with an open Data Environment Object, the back-links of the tables contained in the Data Environment are destroyed. Consecutive access of these tables will yield this error:
RESOLUTIONThe tables must be opened exclusively to properly update the back links. If the tables are not opened exclusively the following error will occur in the Init event of the DataEnvironment class:
To work around this behavior, be sure to release all DataEnvironment
objects before issuing the CLEAR ALL command.
STATUSThis behavior is by design.
MORE INFORMATIONData Environments can be classed programatically. Once instantiated, you may issue the CLEAR ALL command with open tables and database containers. If the CLEAR ALL command is issued with an open Data Environment Object, the tables open at that time lose their links to the database container. This does not occur with forms' Data Environments.
Code to Demonstrate BehaviorThe following program demonstrates this behavior. Each time this program is run subsequent to the first time, Visual FoxPro produces the error listed above for each table that the DataEnvironment class defines. SET DEFAULT TO c:\vfp CLOSE DATA oDe = CreateObject('de') DEFINE CLASS de AS DataEnvironment
Name = "DE" AutoCloseTables = .F. AutoOpenTables = .T. InitialSelectedAlias = "customer" ADD OBJECT oCustomer AS cursor WITH ; PROCEDURE Init
ENDPROC
ENDDEFINE
Additional reference words: 3.00 3.00b VFoxWin KBCategory: kbprg kbprb KBSubcategory: FxprgTable
|
Last Reviewed: August 1, 1996 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |