The Recordset Object - PowerPoint PPT Presentation

griffin-parrish
the recordset object n.
Skip this Video
Loading SlideShow in 5 Seconds..
The Recordset Object PowerPoint Presentation
Download Presentation
The Recordset Object

play fullscreen
1 / 6
Download Presentation
The Recordset Object
82 Views
Download Presentation

The Recordset Object

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. The Recordset Object

  2. Recordset Object (ADO) • When you use ADO, you manipulate data almost entirely using Recordset objects. • A Recordset object represents the entire set of records from a database table or the results of an executed command. • All Recordset objects are constructed using records (rows) and fields (columns).

  3. Recordset Navigation Methods • Navigate through the records in a Recordset with the following Recordset methods • MoveFirst • MoveLast • MoveNext • MovePrevious • Move • Examples: Adodc1.Recordset.Move +5 Adodc1.Recordset.MoveFirst Adodc1.Recordset.MoveLast

  4. RecordsetBOF and EOF Properties • The BOF and EOF properties indicate the beginning or end of the Recordset. • The BOF or EOF property is True when you move one record past the first or last record. • If both BOF and EOF are True, there are no records in the Recordset. • Example: If Adodc1.Recordset.BOF = True Then Adodc1.Recordset.MoveFirst

  5. RecordsetRecordCount Property • Use the RecordCount property to return the number of records in a Recordset object. • The property returns -1 when ADO cannot determine the number of records. • Reading the RecordCount property on a closed Recordset causes an error. • Example: txtRecordCount.Text = Adodc1.Recordset.RecordCount

  6. RecordsetAbsolutePosition Property • Use the AbsolutePosition property to determine the current record number • The AbsolutePosition property is a Long Integer between 1 and the number of records in the Recordset. • Example: txtCurrentRecord.Text = Adodc1.Recordset.AbsolutePosition