Objective Grid: Requerying the recordset does not reflect changes in the row count

Article ID: 364
Last updated: 27 Apr, 2018
Article ID: 364
Last updated: 27 Apr, 2018
Revision: 3
Views: 1836
Posted: 24 Jan, 2001
by Meltreger B.
Updated: 27 Apr, 2018
by Meltreger B.

Problem

 


After I requery the recordset the grid does not reflect any changes in the row count, it even crashes sometimes.

 

 


Cause

 


 

 


Action

 


This can happen when you call CRecordset::Requery() directly.

ACTION:

It is very important that you have to call Requery() for the grid and not for the recordset.

Example:

void CMyRecordView::OnRecordRequery()
{
BOOL bLock = LockUpdate();
SetTopRow(1);
MoveCurrentCell(GX_TOPLEFT);
Requery();
LockUpdate(bLock);
Redraw();
}

This article was:   Helpful | Not helpful
Report an issue
Article ID: 364
Last updated: 27 Apr, 2018
Revision: 3
Views: 1836
Posted: 24 Jan, 2001 by Meltreger B.
Updated: 27 Apr, 2018 by Meltreger B.

Others in this category