Navigating through Recordsets

Navigation through recordsets is based on the concept of a current record. You can imagine that the current record as the particular record that is highlighted by an invisible cursor as you move through the recordset.

You can use the Move methods with the AdvancedDataControl object to navigate through the data records displayed in the data-bound controls on a Web page. For example, suppose you display a recordset in a grid by binding to an AdvancedDataControl object. You can then include First, Last, Next, and Previous buttons that users can click to move to the first, last, next, or last record in the displayed recordset. You do this by calling the MoveFirst, MoveLast, MoveNext, and MovePrevious methods of the AdvancedDataControl object in the OnClick procedures for the First, Last, Next, and Previous buttons, respectively:

' Move to the first record in the bound recordset.
Sub First_OnClick
	ADC1.MoveFirst
End Sub

' Move to the next record from the current position 
' in the bound recordset.
Sub Next_OnClick
	ADC1.MoveNext
End Sub

' Move to the previous record from the current position
' in the bound recordset.
Sub Previous_OnClick
	ADC1.MovePrevious
End Sub

' Move to the last record in the bound recordset.
Sub Last_OnClick
	ADC1.MoveLast
End Sub


© 1997 Microsoft Corporation. All rights reserved.

© 1997 Microsoft Corporation. All rights reserved.

© 1997 Microsoft Corporation. All rights reserved.