Skip to content

Latest commit

 

History

History
24 lines (21 loc) · 1.57 KB

recordset-positioning.md

File metadata and controls

24 lines (21 loc) · 1.57 KB
title Recordset Positioning
description Recordset Positioning
author rothja
ms.author jroth
ms.date 01/19/2017
ms.service sql
ms.subservice ado
ms.topic conceptual
helpviewer_keywords
record positioning [ADO]
Recordset object [ADO]
repositioning record [ADO]
AbsolutePosition property [ADO]

Recordset Positioning

Use the AbsolutePosition property to move to a record, based on its ordinal position in the Recordset object, or to determine the ordinal position of the current record. The provider must support the appropriate functionality for this property to be available.

AbsolutePosition is 1-based and equals 1 when the current record is the first record in the Recordset. As mentioned previously, you can obtain the total number of records in the Recordset object from the RecordCount property.

When you set the AbsolutePosition property, even if it is to a record in the current cache, ADO reloads the cache with a new group of records starting with the record you specified. The CacheSize property determines the size of this group.

Note

You should not use the AbsolutePosition property as a surrogate record number. The position of a given record changes when you delete a preceding record. There also is no assurance that a given record will have the same AbsolutePosition if the Recordset object is requeried or reopened. Bookmarks are the recommended way of retaining and returning to a given position and are the only way of positioning across all types of Recordset objects.