PreviousActiveX Controls Guide (9.1 revision 1) Next

Position

Show this topic in Library frames

Applies to:

VAccess

Description

Returns the value of the physical position of the current record in the Pervasive.SQL table associated with the VAccess control. Sets the physical position value to be used by the subsequent methods that require a physical position.

Remarks

This property is not available at design time.

The Position property is a long integer which uniquely identifies an individual record in a Pervasive.SQL file. Setting this property prior to invoking a GetDirect method will retrieve the record identified by this property directly, without making an indexed search of the file.

You can use the value of this property to keep "bookmarks" to individual records in a data file as you retrieve them.

The data control keeps track of whether or not the Position property value is current. If the property value is read when it is not current, the control will make a GetPosition call to return the current value. Setting this property value in code marks the value as current internally, but does not change current positioning, which may be done by calling the GetDirect method.

Example

Dim bookmark As Long 
'Get the first of a number of duplicate key entries,  
'and bookmark the record 
Customer.IndexNumber = 3 'companyName 
Customer.FieldValue("companyName") = "Consolidated Inc" 
stat = Customer.GetEqual 
bookmark = Customer.Position 
'count the number of duplicate records 
While stat = 0 And Customer.FieldValue("companyName") = 
"Consolidated Inc" 
  dups = dups + 1 
  stat = Customer.GetNext 
Wend 
'reestablish positioning on the first duplicate record 
and lock it 
Customer.Position = bookmark 
stat = Customer.GetDirect (BTO_SingleNoWait) 

See Also:

Affects: GetDirect

Affected by: ExtendedOps, Row, GetDirect, GetEqual, GetFirst, GetGreater, GetGreaterOrEqual, GetLast, GetLess, GetLessOrEqual, GetNext, GetNextExtended, GetPrevious, GetPreviousExtended, StepFirst, StepLast, StepNext, StepNextExtended, StepPrevious, StepPreviousExtended


Chapter contents
Publication contents

Prev topic: Port
Next topic: RefreshLocations