Database application can be created using data control. The data
control support some methods that are useful in manipulating the database, for
example, to move the pointer to a certain location. The following are some of
the commands that you can use to move the pointer around:
Private Sub Command2_Click()
dtaBooks.Recordset.MoveFirst
End Sub
Private Sub Command1_Click()
dtaBooks.Recordset.MoveNext
End Sub
Private Sub Command3_Click()
dtaBooks.Recordset.MovePrevious
End Sub
Private Sub Command4_Click()
dtaBooks.Recordset.MoveLast
End Sub
data_navigator.RecordSet.MoveFirst ' Move to the first recordYou can also add, save and delete records using the following commands:
data_navigator.RecordSet.MoveLast ' Move to the last record
data_navigator.RecordSet.MoveNext ' Move to the next record
data_navigator.RecordSet.Previous ' Move to the first record
data_navigator.RecordSet.AddNew ' Adds a new record*note: data_navigator is the name of data control
data_navigator.RecordSet.Update ' Updates and saves the new record
data_navigator.RecordSet.Delete ' Deletes a current record
Private Sub Command2_Click()
dtaBooks.Recordset.MoveFirst
End Sub
Private Sub Command1_Click()
dtaBooks.Recordset.MoveNext
End Sub
Private Sub Command3_Click()
dtaBooks.Recordset.MovePrevious
End Sub
Private Sub Command4_Click()
dtaBooks.Recordset.MoveLast
End Sub
No comments:
Post a Comment