FIX: TABLEREVERT() with Table Buffering Results in Page Fault (174530)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0b
- Microsoft Visual FoxPro for Macintosh 3.0b
This article was previously published under Q174530 SYMPTOMS
Closing a form containing a grid with two or more related record sources
and table buffering enabled results in an Windows Application Error or
Macintosh error type 11 and termination of Visual FoxPro.
Under some circumstances, closing a form containing a grid with multiple
record sources and table buffering enabled, results in an application error
and abnormal termination of Visual FoxPro. This article describes the
conditions under which an application error may occur and a workaround that
resolves the problem.
CAUSE
The occurrence of an application error and abnormal termination of the
Visual FoxPro session, under these conditions, is dependent on a specific
sequence of events. This behavior occurs only under the following
circumstances:
- A form is created, containing a grid based on two or more related
record sources.
- The child table is USEd in the form's DataEnvironment, Load, or Init
event before the Parent table is USEd.
- A many-to-one relationship is established between the child table and
the parent table.
- The Grid.RecordSourceType Property is set to 1 (ALIAS).
- The Grid.RecordSource Property is the alias of the child table.
- The Grid.ColumnCount is set to a value of at least two.
- The ControlSource Property for at least one column of the Grid is a
field in the parent table.
- The ControlSource Property for at least one column of the Grid is a
field in the child table.
- Table buffering on the child table is enabled.
- A TABLEREVERT(.t.,'Child Table Name') is issued.
- The open tables are closed either in the DataEnvironment or by issuing
a CLOSE TABLES command.
RESOLUTION
Multiple workarounds are available for this condition:
Insert ThisForm.Grid.RecordSource="" before releasing the form or
issuing a 'CLOSE TABLES' command.
-or-
Use a view or SQL Cursor as the record source for the grid.
-or-
Base Grids with multiple record sources on the parent table.
-or-
Instantiate cursors for parent tables prior to instantiating cursors
for child tables.
-or-
Use row buffering instead of table buffering.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug has been corrected in Visual
FoxPro 5.0.
Modification Type: | Major | Last Reviewed: | 10/15/2003 |
---|
Keywords: | kbbug kbfix KB174530 |
---|
|