Click or drag to resize

DbServer.Seek Method (Usual, Usual, Usual)

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

Namespace:  XSharp.VO.SDK
Assembly:  XSharp.VORDDClasses (in XSharp.VORDDClasses.dll) Version: 2.19
Request Example View Source


uSearchExpr (Optional)
Type: Usual
Specifies the key value associated with the desired record.
lSoftSeek (Optional)
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 (Optional)
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: Logic
TRUE if the specified key value was found; otherwise, FALSE.
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.
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:
1IF Employee:Seek( UPPER( SELF:oDCsleLastName:Value ) )
2   Employee:ViewRecord()
4   QOut("Not found")
See Also