The information in this article applies to:
SYMPTOMSIf a Grid's RecordSource property is set to a cursor and 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 or ThisForm.<GridName>.Refresh command. CAUSEWhen you execute a SQL Select statement into the same cursor specified in the grid's RecordSource property, the original cursor has to be destroyed before the new cursor can be created. When this happens, the grid columns and the RecordSource are also cleared and then re-created. The grid's record source is set to the new cursor, and the grid automatically creates columns. The new grid is working from scratch, so it does not load the data from the cursor. RESOLUTIONTo refresh the grid in this situation, set the Grid's RecordSource property to itself as in this example:
STATUSThis behavior is by design. MORE INFORMATIONFor more information, please see the following article in the Microsoft Knowledge Base: Q140653 PRB: Cursor-Based Grid Goes Blank If SQL SELECT Resets Cursor Steps to Reproduce Behavior
To have the grid display the data correctly, place the following command as the last line of code for the Click event of the command button:
Additional query words:
Keywords : kbMAC kbVFp kbVFp300 kbVFp500 kbVFp600 FxprgGrid |
Last Reviewed: August 5, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |