DbServer Class (Typed) |
Namespace: XSharp.VO.SDK
The DbServer type exposes the following members.
Name | Description | |
---|---|---|
DbServer(Usual, Object, Object, String, Array) |
Construct a server object.
| |
DbServer(FileSpec, Object, Object, String, Array) |
Construct a server object.
|
Name | Description | |
---|---|---|
Alias |
A string representing the alias of the work area.
| |
AliasSym |
A symbol representing the alias of a DBServer object.
| |
BoF |
A logical value indicating whether the server is positioned at the beginning of the file, on the first record.
(Overrides BoF.) | |
Clients | **Missing documentation ** (Inherited from DataServer.) | |
ConcurrencyControl |
A constant, identifying the mode of automatic concurrency control for this data server, determining when and how records are locked and released:
(Overrides ConcurrencyControl.) | |
DBStruct |
An array containing the structure of this data server, whose length (that is, number of elements) is equal to the number of fields in the server.
(Overrides DBStruct.) | |
DbStructure | Return the original dbstructure array from the DbServer object. | |
Deleted |
A logical value indicating whether the current record is marked as deleted.
| |
Driver |
A string representing the name of the database driver in use with this server.
| |
EoF |
A logical value indicating whether the server is positioned at the end of the file, on the last record
(Overrides EoF.) | |
ErrInfo |
An Error object identifying the error condition after the last operation.
| |
ErrorInfo | Returns the internal ErrorInfo object, regardless of the last operation produced an error or not. | |
FCount |
The number of fields in the server.
(Overrides FCount.) | |
FieldDesc | This returns an empty array. For servers that were painted in the DbServer editor this returns the array of DataFields. | |
FileSpec |
The FileSpec object that defines the path and file name of the DBF file.
| |
Filter |
A string representing the current active filter.
| |
ForBlock |
The "FOR block" component of the "general server scope," which affects several bulk processing methods if they are called with no explicit scope.
| |
Found |
A logical value indicating whether the previous search operation succeeded.
| |
Header |
A numeric value representing the length of the database file header.
| |
HLStatus | **Missing documentation ** (Inherited from DataServer.) | |
HyperLabel |
The hyperlabel connected to this data server. From the hyperlabel, you can retrieve additional information about the data server
(Inherited from DataServer.) | |
IndexExt |
A string representing the default index extension based on the database driver currently linked (for example, ".NTX" for the DBFNTX driver).
| |
IndexList | This returns an empty array. For servers that were painted in the DbServer editor this returns the array of Indexes. | |
LastRec |
The number of records in the current database file.
(Overrides LastRec.) | |
Lupdate |
The last modification date of the DBF file used in the server.
| |
MemoExt | This returns the memo extension of the file (if any). For example DBT or FPT. | |
Name | This returns the name of the DbServer. (Overrides Name.) | |
NameSym |
A symbol representing the name of this data server.
(Inherited from DataServer.) | |
OleExt | This returns the OLE extension of the file (if any). For example DFL. | |
OrderBottomScope |
A key value representing the record of the bottom boundary in the range of key values that will be included in the controlling order's current scope.
| |
OrderKeyVal |
The key value of the current record from the controlling order.
| |
OrderTopScope |
A key value representing the record of the top boundary in the range of key values that will be included in the controlling order's current scope.
| |
PaintedStructure | This returns a DBSTRUCT array based on the DataFields and Fieldspecs that were painter in the server editor. | |
RddName |
A string representing the name of the database driver in use with this server.
| |
Rdds | This returns the list of RDDs that were passed to the DbServer constructor. | |
ReadOnly |
A logical value indicating whether the file was opened as a read-only file. This is determined by an instantiation parameter of the server.
| |
RecCount |
The number of records in the current database file.
(Overrides RecCount.) | |
RecNo |
A numeric value representing the current record number, identifying the position of the record pointer.
(Overrides RecNo.) | |
RecSize |
A numeric value representing the record length of the server in bytes.
| |
RelationChildren | The returns the array of children that were registered with SetRelation() | |
Retries | The setting that determines how often the DbServer object should retry operations that fail. | |
RLockList |
An array of record numbers that are currently locked.
| |
Scope |
The "scope" component of the "general server scope," which affects several bulk processing methods if they are called with no explicit scope. The initial value of the scope is NIL.
| |
SelectionWorkArea | The workarea number of the parent area when the dbserver is a child in a relation. | |
Shared |
A logical value indicating whether the server is sharable or exclusive.
| |
Status |
A HyperLabel object identifying the status after the last operation. If
(Overrides Status.) | |
TableExt | Return the Extension for the opened DBF. This is normally .DBF but may be different if a file with a different extension was opened. | |
Used |
A logical value indicating whether the server is currently open
| |
WhileBlock |
The "WHILE block" component of the "general server scope," which affects several bulk processing methods if they are called with no explicit scope
| |
WorkArea |
A number representing the workarea of the server
|
Name | Description | |
---|---|---|
Append |
Append a blank record to the table; this blank record becomes the current position and is ready for assignment of data values. The record is automatically locked if the Append() method returns TRUE.
| |
Append(Logic) |
Append a blank record to the table; this blank record becomes the current position and is ready for assignment of data values. The record is automatically locked if the Append() method returns TRUE.
(Overrides Append(Logic).) | |
AppendDB |
Append new records to the table from another DBF file.
| |
AppendDelimited |
Append new records to the table from a delimited file, such as the "comma-separated-value" (CSV) file format.
| |
AppendSDF |
Append new records to the table from an SDF-formatted file.
| |
AsString |
Return the descriptive label defined for this data server.
(Inherited from DataServer.) | |
Average |
Calculate the average of a series of numeric expressions, based on the number of actual records involved.
| |
BLOBDirectExport(Long, String, Long) |
Export the contents of a binary large object (BLOB) pointer to a file.
| |
BLOBDirectExport(Long, FileSpec, Long) |
Export the contents of a binary large object (BLOB) pointer to a file.
| |
BLOBDirectGet |
Retrieve data stored in a BLOB file without referencing a specific field.
| |
BLOBDirectImport(Long, String) |
Import a file into a BLOB file and return a pointer to the data.
| |
BLOBDirectImport(Long, FileSpec) |
Import a file into a BLOB file and return a pointer to the data.
| |
BLOBDirectPut |
Put data in a BLOB file without referencing a specific field.
| |
BLOBExport(Usual, String, Long) |
Copy the contents of a BLOB, identified by its memo field number, to a file.
| |
BLOBExport(Usual, FileSpec, Long) |
Copy the contents of a BLOB, identified by its memo field number, to a file.
| |
BLOBGet |
Get the contents of a BLOB, identified by its memo field number.
| |
BLOBImport |
Read the contents of a file as a BLOB, identified by a memo field number.
| |
BLOBRootGet |
Retrieve the data from the root area of a BLOB file.
| |
BLOBRootLock |
Obtain a lock on the root area of a BLOB file.
| |
BLOBRootPut |
Store data in the root area of a BLOB file.
| |
BLOBRootUnlock |
Release the lock on a BLOB file's root area.
| |
ClearFilter |
Clear a filter condition specified with the DBServer:SetFilter() method.
| |
ClearIndex |
Clear all indexes currently associated with the server.
| |
ClearLocate |
Clear the LOCATE condition of the server, if any.
| |
ClearOrderScope |
Set or clear the boundaries for scoping key values in the controlling order.
| |
ClearRelation |
Clear all active relations held by this server to other servers.
| |
ClearScope |
Clear the settings that define the default scope for multi-record operations.
| |
Close |
Close the database file and its associated index files.
(Overrides Close.) | |
Commit |
Commit all changes to disk from the buffer, ensuring that all buffers are flushed.
(Overrides Commit.) | |
ConstructUniqueAlias | Create a unique alias based on the filename and an optional numeric suffix | |
Continue |
Resume a pending DBServer:Locate() operation, searching for the next record that matches (like the DBContinue() function).
| |
CopyDB |
Copy records to another DBF file.
| |
CopyDelimited |
Copy records to a delimited file.
| |
CopySDF |
Copy records to an SDF file.
| |
CopyStructure(String, Array) |
Create a DBF file with the same record layout as the server object to which the message is sent.
| |
CopyStructure(FileSpec, Array) |
Create a DBF file with the same record layout as the server object to which the message is sent.
| |
Count |
Return the number of records that match a specified scope.
| |
CreateIndex |
Create an index file with an order in it.
| |
CreateOrder |
Create an order within an existing index file. The behavior depends on which driver is used.
| |
DataField |
Retrieve the data field object at the specified field position.
(Overrides DataField(Usual).) | |
Delete |
Delete the current record in this data server.
(Inherited from DataServer.) | |
Delete(Usual, Usual, Usual) |
Delete the current record or the records specified with the scoping parameters.
| |
DeleteAll |
Delete all records of the table.
| |
DeleteOrder |
Delete an order from an index file.
| |
Error |
Provide a method for handling error conditions raised during database processing.
| |
Eval |
Evaluate a code block for each record matching a scope and condition. If neither conditions nor scope is passed to the method, it is subject to the general server scope.
| |
FieldGet |
Get the contents of a field that is identified by its position.
(Overrides FieldGet(Usual).) | |
FieldGetBytes |
Read an array of bytes direct from the workarea buffer.
| |
FieldGetFormatted |
Return the contents of a specified field according to the formatting specifications of its FieldSpec object.
(Overrides FieldGetFormatted(Usual).) | |
FieldHyperLabel |
Return the hyperlabel of a specified field.
(Overrides FieldHyperLabel(Usual).) | |
FieldInfo |
Return and optionally change information about a field.
| |
FieldName |
Return the name of a specified field as a string.
(Overrides FieldName(Usual).) | |
FieldPos |
Return the position of a specified field within the data server, as a number starting with 1.
(Overrides FieldPos(Usual).) | |
FieldPut |
Set the value of a field identified by its position.
(Overrides FieldPut(Usual, Usual).) | |
FieldPutBytes | Write an array of bytes direct to the workarea buffer. | |
FieldSpec |
Return the FieldSpec object in the specified field.
(Overrides FieldSpec(Usual).) | |
FieldStatus |
Return the status of a field after the last operation.
(Overrides FieldStatus(Usual).) | |
FieldSym |
Return the name of a specified field.
(Overrides FieldSym(Usual).) | |
FieldValidate |
Perform all the validations defined to the FieldSpec object of a field (for example, required, maximum and minimum digits, maximum and minimum value, validation rule) and return the result of the test.
(Overrides FieldValidate(Usual, Usual).) | |
FLock |
Lock the table used by this server for exclusive access.
(Overrides FLock.) | |
GetArray |
Retrieve an array of values from a field in the server, subject to the currently active selection, if any.
| |
GetLocate |
Retrieve the code block of the current LOCATE condition, or NIL if no code block is set.
| |
GetLookupTable |
Retrieve a two-column array of values from two fields in the server, subject to the currently active selection, if any.
(Overrides GetLookupTable(Usual, Usual, Usual, Usual).) | |
GoBottom |
Position the data server at the last record.
(Overrides GoBottom.) | |
GoTo |
Position the data server at a specified record number.
(Overrides GoTo(Long).) | |
GoTop |
Position the data server at the first record.
(Overrides GoTop.) | |
IndexKey |
Return the key expression of a specified single-order index.
| |
IndexOrd |
Return the ordinal position of the controlling order in the order list. (Similar to the IndexOrd() function.)
| |
Info |
Return and optionally change information about a data server.
| |
Join |
Join this DBServer object with another DBServer object and place the results in the file specified.
| |
Locate |
Search sequentially for a record matching a condition. If neither conditions nor scope is passed to the method, it is subject to the general server scope.
| |
LockCurrentRecord |
Lock the current record. This method is identical to invoking RLock() with the current record number as a parameter.
(Overrides LockCurrentRecord.) | |
LockSelection |
Lock all the records in the currently active selection.
| |
NoIVarGet |
Provide a general error interception that is automatically called (in any class) whenever an access reference is made to a non-existent exported instance variable. In the DBServer class, it is used to implement the virtual field variable.
(Overrides NoIVarGet(Usual).)Important! NoIVarGet() should not be called directly; it is called by the system for handling invalid references. | |
NoIVarPut |
Provide a general error interception that is automatically called (in any class) whenever an assignment reference is made to a non-existent exported instance variable. In the DBServer class, it is used to implement the virtual field variable.
(Overrides NoIVarPut(Usual, Usual).)Important! NoIVarPut() should not be called directly; it is called by the system for handling invalid references. | |
Notify |
An event handler that responds to events that have occurred in methods of this server, or in other servers that are linked to this server in some way. The standard implementation notifies all the server's clients of the event.
(Overrides Notify(Long, Usual).)Important! This method is automatically called by the various action methods of the data server, and should normally not be called by application code. | |
OrderDescend(Usual, String, Usual) |
Return and optionally change the descending flag of an order.
| |
OrderDescend(Usual, FileSpec, Usual) |
Return and optionally change the descending flag of an order.
| |
OrderInfo |
Return and optionally change information about orders and index files.
| |
OrderIsUnique(Usual, String) |
Return the status of the unique flag for a given order.
| |
OrderIsUnique(Usual, FileSpec) |
Return the status of the unique flag for a given order.
| |
OrderKeyAdd(Usual, String, Usual) |
Add a key to a custom built order.
| |
OrderKeyAdd(Usual, FileSpec, Usual) |
Add a key to a custom built order.
| |
OrderKeyCount(Usual, String) |
Return the number of keys in an order.
| |
OrderKeyCount(Usual, FileSpec) |
Return the number of keys in an order.
| |
OrderKeyDel(Usual, String) |
Delete a key from a custom built order.
| |
OrderKeyDel(Usual, FileSpec) |
Delete a key from a custom built order.
| |
OrderKeyGoTo |
Move to a record specified by its logical record number in the controlling order.
| |
OrderKeyNo(Usual, String) |
Get the logical record number of the current record.
| |
OrderKeyNo(Usual, FileSpec) |
Get the logical record number of the current record.
| |
OrderScope |
Set the boundaries for scoping key values in the controlling order.
| |
OrderSkipUnique |
Move the record pointer to the next or previous unique key in the controlling order.
| |
Pack |
Remove deleted records from a database file.
| |
PostInit |
Implement customized initialization code for the window.
(Inherited from DataServer.) | |
PreInit |
Implement customized initialization code for the server.
(Inherited from DataServer.) | |
RddInfo |
Return and optionally change settings controlled directly by the RDD.
| |
Recall |
Recall those deleted records indicated by a specified scope.
| |
RecallAll |
Recall all deleted records in the table.
| |
RecordInfo |
Retrieve information about the indicated record.
| |
Refresh |
Reread the current record from the database, discarding any changes that have been made.
| |
RegisterClient |
Register an object as a client of this data server, so that it receives notification messages from the server about certain actions.
(Inherited from DataServer.) | |
Reindex |
Recreate all active indexes for this server.
| |
Relation |
Return the linking expression of a specified relation.
| |
Replace |
Replace one or several fields with a new expression, for all records that match a specified scope.
| |
ResetNotification |
Resume the broadcasting of Notify messages to the server's attached clients (after DBServer:SuspendNotification() has been called).
(Overrides ResetNotification.) | |
RLock |
Lock a record for exclusive write access; other users can still make read-only reference to the record.
(Overrides RLock(Long).) | |
RLockVerify |
Determine if the current record in this data server has any pending updates and lock it for exclusive write access if there are none.
(Overrides RLockVerify.) | |
Rollback |
Undo the changes made to this data server within the current transaction.
(Inherited from DataServer.) | |
Seek |
Move to the next record having a specified key value in the controlling order.
(Inherited from DataServer.) | |
Seek(Usual, Usual, Usual) |
Move to the record having the specified key value in the controlling order.
| |
Select | Select the workarea that the DbServer uses. | |
SetDataField |
Assign a DataField object to a specified field.
(Overrides SetDataField(DWord, DataField).) | |
SetFilter |
Set a filter condition.
| |
SetIndex(String) |
Open an index file and select its order as the controlling order, if this is the first index being opened.
| |
SetIndex(FileSpec) |
Open an index file and select its order as the controlling order, if this is the first index being opened.
| |
SetOrder(Usual, String) |
Select an order from one of the open index files as the controlling order.
| |
SetOrder(Usual, FileSpec) |
Select an order from one of the open index files as the controlling order.
| |
SetOrderCondition |
Set conditions that is applied to index and order creation. If SetOrderCondition() has not been called, order creation is subject to the general server scope. If neither has been set, orders are not conditional.
| |
SetRelation |
Set a relation from this server to the child server.
| |
SetSelectiveRelation |
Set a selective relation from this server to the child server; standard database operations are restricted to those records that match the relation.
| |
Skip |
Move the record pointer forward or backward a specified number of records.
(Overrides Skip(Long).) | |
Sort(String, Array, Usual, Usual, Usual) |
Copy records to another database file in sorted order. If neither conditions nor scope is passed to the method, it is subject to the general server scope.
| |
Sort(FileSpec, Array, Usual, Usual, Usual) |
Copy records to another database file in sorted order. If neither conditions nor scope is passed to the method, it is subject to the general server scope.
| |
Sum |
Calculate the sum of a series of numeric expressions.
| |
SuspendNotification |
Suspend the broadcasting of Notify messages to the server's attached clients.
(Overrides SuspendNotification.) | |
Total |
Aggregate records by key value, producing grouped summarizations, and write the aggregate records to another database.
| |
UnLock |
Release a specified lock or all locks.
(Overrides UnLock(Long).) | |
UnRegisterClient |
Remove the registration of an object as a client of this data server, so that it no longer receives notification messages from the server about certain actions.
(Inherited from DataServer.) | |
Update |
Update this server with data from another server or table.
(Inherited from DataServer.) | |
Update(Usual, Usual, Usual, Usual) |
Update this server with data from another server or table.
| |
Zap |
Permanently remove all records from the server and release the disk space.
|
Method or Property | Description |
---|---|
BOF | Attempt to position before first record in selection. |
EOF | Attempt to position after last record in selection. |
Found | Indicates if a record is found within the selection only (after Seek(), Locate(), Continue()) |
RecCount | Returns number of records in selection (note that LastRec is not dependent on selection) |
Average() | If no scope is specified, makes the calculation over the current selection instead of ALL records |
Continue() | Limits the search to the current selection |
CopyDB(), CopySDF(), CopyDelimited() | If no scope is specified, copies the current selection instead of ALL records |
Count() | If no scope is specified, makes the calculation over the current selection instead of ALL records |
DeleteAll() | Deletes all the records of the selection, instead of all records in the file |
Eval() | If no scope is specified, evaluates the code block over the current selection instead of ALL records |
GetArray() | Limits array to current selection |
GetLookupTable() | Limits array to current selection |
GoTop() | Goes to first record in selection |
GoTo() | Fails if the record number is not within selection |
GoBottom() | Goes to last record in selection |
Locate() | Succeeds only if the record is found within the selection |
LockSelection() | Locks all records in the current selection |
RecallAll() | Recalls all the records of the selection, instead of all records in the file |
Replace() | If no scope is specified, processes the current selection instead of ALL records |
Seek() | Positions to the beginning of the current selection—only if the seek value is the same as the selection value; otherwise, positions to the last record of the file and set the EOF flag. (Softseek is ignored.) |
Skip() | If the move would lead out of the selection: positions to the last record of the selection and sets the EOF flag or positions to the first record in the selection and sets the BOF flag, depending on the direction of the move. |
Sort(), Sum(), Total() | If no scope is specified, processes the current selection instead of ALL records |
Tip |
---|
The following methods are not subject to the limitations of an active selection: AppendDB(), AppendDelimited(), and AppendSDF(), because their scoping parameters apply to the source file, not to this server Delete(), because its default is this record rather than all Recall(), because its default is this record rather than all |
1oDB:Scope := 5 // NEXT 5 records 2oDB:Delete() 3oDB:Scope := NIL // Don't forget to reset the scope!
1oDB:Scope := DBScopeRest // REST 2oDB:Delete() 3oDB:Scope := NIL // Don't forget to reset the scope!
1oDBCust:SetOrder("CustomerName") // ORDER by name 2oDBCust:Seek("Smith") // FIND first Smith 3oDBCust:WhileBlock := {||CustomerName = "Smith"} 4// WHILE still on the Smiths... 5oDBCust:ForBlock := {||State = "NJ"} // FOR // customers 6// in NJ... 7Tally := oDBCust:Count() // COUNT 'em! 8oDBCust:ClearScope() // RESET everything
Method Name | Description |
---|---|
AppendDB() | Append records from DBF. |
AppendDelimited() | Append records from delimited file. |
AppendSDF() | Append records from SDF file. |
Average() | Calculate average of expressions. |
CopyDB() | Copy records to DBF. |
CopyDelimited() | Copy records to delimited file. |
CopySDF() | Copy records to SDF file. |
Count() | Count how many records match. |
Delete() | Delete records. |
Eval() | Evaluate code block for each record. |
Join() | Join with another DBF, write to DBF. |
Locate() | Find record that matches conditions. |
Recall() | Recall deleted records. |
Replace() | Replace values with data from DBF. |
Sort() | Sort records to a DBF. |
Sum() | Calculate sums of expressions. |
Total() | Summarize fields to a DBF. |
Method Name | Description |
---|---|
Delete() | Delete current record. |
DeleteAll() | Delete all records. |
Recall() | Recall current record. |
RecallAll() | Recall all records. |
1oDBCust := DBServer{"customer"} 2cCust := oDBCust:Alias 3SELECT (cCust) 4SKIP 5DELETE 6? (cCust) -> CustNo
1DbSetRestoreWorkarea (lEnable)
Tip |
---|
There have been some major changes in the DbServer class in X#. Please read the section on the bottom of this topic carefully if you are migrating from an older version of Visual Objects. |