ComponentOne List 8.0 for ActiveX
How True DBList reacts to Recordset changes

When you bind a list to a Data control, you are actually linking the list to the underlying Recordset object, which is managed by the Data control. The Recordset object can be accessed directly using the Recordset property of the Data control:

Example Title
Copy Code
Data1.Recordset.MoveFirst

This statement positions the record pointer to the first record in the Recordset.

As of Visual Basic 4.0, the Data control does not support the outdated Dynaset object. You can create a Table, Snapshot, or Dynaset-type Recordset using the Data control's RecordsetType property. By default, the Data control creates a Dynaset-type Recordset that is completely compatible with the Dynaset object, so you should not have to modify any existing code. Consult the Visual Basic Help for more information.

Here is how the list responds to various operations performed on the Recordset associated with the Data control:

Positioning

The list's current row will change in response to a successful invocation of any of the following Recordset methods: Seek, Move, MoveFirst, MoveLast, MoveNext, MovePrevious, FindFirst, FindLast, FindNext, and FindPrevious. If necessary, the list will scroll to make the current row visible. The list optimizes its response to these messages. For example, if your code performs a MoveFirst followed by 20 consecutive MoveNext calls, the list will position only once, to the 21st row. Consult the Visual Basic Help for more information on the Recordset object's methods.

Delete

True DBList reacts to the Recordset object's Delete method by removing the current row from the list display. However, the Delete method does not change the current record, therefore the Bookmark property of both the list and the Recordset still refers to the record that was just deleted. At this point, there is no current row in the list, and its Row property returns -1.

Requery

This method causes the list to refetch and redisplay all data. After the Requery method is executed, the current cell will be the leftmost visible column of the first record, which will be displayed at the upper left corner of the list.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback