A refreshed grid does not display any data when a cursor is updated at run time in Visual FoxPro (131836)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 6.0
- Microsoft Visual FoxPro for Macintosh 3.0b
- Microsoft Visual FoxPro for Windows 7.0
- Microsoft Visual FoxPro 8.0
- Microsoft Visual FoxPro 9.0 Professional Edition
This article was previously published under Q131836 SYMPTOMSIn 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.
Modification Type: | Major | Last Reviewed: | 3/17/2005 |
---|
Keywords: | KB131836 |
---|
|