Article ID: 131836
Article Last Modified on 2/12/2007
APPLIES TO
- Microsoft Visual FoxPro 3.0 Standard Edition
- Microsoft Visual FoxPro 5.0 Standard Edition
- Microsoft Visual FoxPro 6.0 Professional Edition
- Microsoft Visual FoxPro 3.0b for Macintosh
- Microsoft Visual FoxPro 7.0 Professional Edition
- Microsoft Visual FoxPro 8.0 Professional Edition
- Microsoft Visual FoxPro 9.0 Professional Edition
This article was previously published under Q131836
SYMPTOMS
In Microsoft Visual FoxPro, if the RecordSource property of a grid is set to a cursor and then that cursor is
updated at run time by using a "SQL Select Into Cursor CursorName"
command, the grid does not display any data even if you refresh it by using
the ThisForm.Refresh command or the ThisForm.GridName.Refresh command.
CAUSE
When you execute a SQL Select statement into the same cursor specified in
the RecordSource property of the grid, the original cursor must be destroyed
before the new cursor can be created. When this occurs, the grid columns
and the RecordSource are also cleared and then re-created. The record source of the grid is set to the new cursor, and the grid automatically creates
columns. The new grid is working from scratch. Therefore, it does not load the data
from the cursor.
RESOLUTION
To refresh the grid in this situation, set the
RecordSource property
of the grid to itself as in this example:
thisform.grid1.recordsource=thisform.grid1.recordsource
STATUS
This behavior is by design.
Keywords: KB131836