ADO AbsolutePage and AbsolutePosition Property

Home | About me | EXCEL VB Programming (XL97-2003) | ACCESS Programming | EXCEL VB.Net Programming | EXCEL Spreadsheet Functions Material Management  |  Guestbook
 

ADO AbsolutePage and AbsolutePosition Property

AbsolutePage

The AbsolutePage property sets or returns a long value that specifies the page number in the Recordset object. It sets or returns a value from 1 to the number of pages in the Recordset. The value is 1 when the current record is the first record in the Recordset. You must also be pointing to a valid record when attempting to use this property. If you are not pointing to a valid record, this property will return one of the PositionEnum constants (either BOF, EOF, or empty) which specify the current position of the record pointer in the Recordset.

The first page is always numbered one. You use the PageSize property to set how many records are on a page. You use the PageCount property to determine how many pages are in the Recordset.

Note: This property can only be used if the AbsolutePage, PageCount, and PageSize properties are supported by the provider (i.e., bookmarks are supported).

AbsolutePosition

The AbsolutePosition property sets or returns a long value that specifies the ordinal (numeric) position of the current record in the Recordset object or the ordinal position of the cursor. It sets or returns a value from 1 to the number of records in the Recordset, or it returns a PositionEnum value. The value is 1 when the current record is the first record in the Recordset. Note that you cannot set this property to any of the PositionEnum constants.

When you set this property to a number, you will be moved to the record at the numeric position.

This property only points to a position and should not be used to uniquely identify a record, since additions, deletions, sorts and other operations can easily rearrange the contents of a recordset.

When you set this property to a position number, you will be moved to the record at the position you have specified. In addition, the Recordset cache is reloaded. The records in the cache will now start at the numeric position in the Recordset you have specified. The total number of records that can be stored in the cache is set by the CacheSize property.

The first record is always numbered one. You can use the RecordCount property to determine the total number of records in the Recordset.

You can only use this property if it is supported by the provider. You must also be pointing to a valid record when attempting to use this property. If you are not pointing to a valid record, this property will return one of the PositionEnum constants which specify the current position of the record pointer in the Recordset. You may also need the set the CursorLocation property to adUseClient since the default for this property is adUseServer.

Syntax

objRecordset.AbsolutePage
objRecordset.AbsolutePosition
 

Example

Code
objRecordset.PageSize = intPageSize
objRecordset.
AbsolutePage = 1


Code
If objRecordset.AbsolutePosition = adPosBOF
   objRecordset.MoveFirst
End If

PositionEnum Values

Constant Value

Description

adPosUnknown -1 Indicates that the Recordset is empty, the current position is unknown, or the provider does not support the AbsolutePage or AbsolutePosition property
adPosBOF -2 Indicates that the current record pointer is before the first record (BOF)
adPosEOF -3 Indicates that the current record pointer is after the last record (EOF)