Comparing AbsolutePosition to PercentPosition in VB 4.0Last reviewed: May 20, 1996Article ID: Q143033 |
The information in this article applies to:
SUMMARYIn Microsoft Visual Basic 4.0 using Jet's DAO model, there are two Properties that can help you determine the current cursor position or that you can use to set the cursor to a certain position. This article will demonstrate both properties and give you some ideas on when to use one or the other.
MORE INFORMATIONAccording information from the online Help, the description of the AbsolutePosition is as follows: Returns or sets the relative record number of a Recordset object's current record. Applies to the Recordset Object as a Dynaset-type or Snapshot- type(except for forward-only Snapshots and passthrough queries). According information from the online Help, the description of the PercentPosition is as follows: Returns or sets a value that indicates or changes the approximate location of the current record in the Recordset object based on a percentage of the records in the Recordset. Applies to all three types of Recordset Objects (except for forward-only Snapshots and passthrough queries). In the following code, I use the rs.MoveLast method before referring to rs.PercentPosition. This is because PercentPosition is dependent on RecordCount, and AbsolutePosition is not. The RecordCount property is not accurate until you move to the end of your Recordset object. Also keep in mind that RecordCount is not always 100 percent accurate, it is just an estimate of the number of rows in your recordset, and therefore PercentPosition is not always accurate--but AbsolutePosition is always accurate. For instance, a dynaset in a multi-user environment does not reflect rows other users have added until you issue the refresh method.
Step-by-Step Example
|
Additional reference words: 4.00 vb4win
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |