Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Following Code Crashes Application

1 view
Skip to first unread message

The Swami

unread,
Aug 8, 2003, 4:18:22 PM8/8/03
to
OK Here is the offending code:

procedure TMyDBGrid.MoveToRow(NewRow: Integer);

// Scrolls the visible records so that the current record is shown

// on the NewRow position (if possible)

var

Mark: TBookmarkStr;

begin

Mark := DataLink.DataSet.Bookmark;

// Set the current row to NewRow

// (this also moves the record pointer)

DataLink.ActiveRecord := NewRow;

// Goto the original record

DbiSetToBookmark(TDBDataSet(DataLink.DataSet).Handle,

Pointer(Mark));

// Force a reread of the record buffer with the current settings

DataLink.DataSet.Resync([rmExact]);

end;

For some reason calling: "Grid.MoveToRow(0);" causes the App to Crash.

Behind the Grid is a TDatasource and A TClientDataSet created in memory.

TMyDB Grid is my own component. I use it to put the current Highlighted row
in a grid as the first row in the grid (even if it is not the first record
in the DataSet).

S

0 new messages