Click or drag to resize

DbServer.Seek Method

Move to the record having the specified key value in the controlling order.

Namespace:  VO
Assembly:  VORDDClasses (in VORDDClasses.dll) Version: 2.5
Syntax
 VIRTUAL METHOD Seek(
	uSearchExpr AS USUAL,
	lSoftSeek AS USUAL,
	lLast AS USUAL
) AS USUAL

Parameters

uSearchExpr
Type: Usual
Specifies the key value associated with the desired record.
lSoftSeek
Type: Usual
Determines how the data server is positioned if the specified key value is not found: TRUE performs a soft seek; FALSE does not.  If <lSoftSeek> is omitted, the current SetSoftSeek() setting is used.
lLast
Type: Usual
TRUE seeks the last occurrence of the specified key value.  FALSE, the default, seeks the first occurrence.  <lLast> only applies to CDX indexes.

Return Value

Type: Usual
TRUE if the specified key value was found; otherwise, FALSE.
Remarks
Sends a NotifyIntentToMove message before the operation. DBServer:Seek() moves to the first logical record whose key value is equal to <uKey>.  If such a record is found, it becomes the current record and DBServer:Seek() returns TRUE.  Otherwise, DBServer:Seek() returns FALSE and the positioning of the data server is as follows: for a normal (not soft) seek, the data server is positioned to DBServer:LastRec + 1 and DBServer:EOF returns TRUE; for a soft seek, the data server is positioned to the first record whose key value is greater than the specified key value.  If no such record exists, the data server is positioned to DBServer:LastRec + 1 and DBServer:EOF returns TRUE. For a data server with no controlling order, DBServer:Seek() has no effect.
Tip Tip
Logical records: DBServer:Seek() operates on logical records.  Records are processed in controlling order.  If a filter is set, only records which meet the filter condition are considered. Shared mode: For a shared file, moving to a different record can cause updates to the current record to become visible to other processes.  For more information, refer to "Concurrency Control" in the Programmer's Guide.
Examples
In this example, DBServer:Seek() moves the pointer to the record in the database, EMPLOYEE, in which the value in the control field sleLastName matches a record in the database:
X#
1IF Employee:Seek( UPPER( SELF:oDCsleLastName:Value ) )
2Employee:ViewRecord()
3ELSE
4QOut("Not found")
5END
See Also