Click or drag to resize

DbAppSdf Function

X#
Import records from an SDF file.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax
 FUNCTION DbAppSdf(
	cSourceFile,
	acFields,
	cbForCondition,
	cbWhileCondition,
	nNext,
	nRecord,
	lRest
) AS LOGIC CLIPPER
Request Example View Source

Parameters

cSourceFile (Optional)
Type: Usual
The name of the SDF file from which to add records, including an optional drive, directory, and extension.
See SetDefault() and SetPath() for file searching and creation rules.
The default extension is .TXT.
This function attempts to open cSourceFile in shared mode.
If the file does not exist, a runtime error is raised.
If the file is successfully opened, the operation proceeds.
If access is denied because, for example, another process has exclusive use of the file, NetErr() is set to TRUE.
acFields (Optional)
Type: Usual
A list of fields to copy from cSourceFile.
The default is all records.
cbForCondition (Optional)
Type: Usual
A code block that defines a condition that each record within the scope must meet in order to be processed.
cbWhileCondition (Optional)
Type: Usual
A code block that defines another condition that each record must meet in order to be processed. As soon as a record is encountered that causes the condition to fail, the operation terminates.
If no scope is specified, cbWhileCondition changes the default scope to lRest.
You define the scope using one of these three, mutually exclusive arguments.
The default is all records.
nNext (Optional)
Type: Usual
The number of records to process, starting at nRecord. Specify 0 to ignore this argument.
nRecord (Optional)
Type: Usual
A single record number to process. Specify 0 to ignore this argument.
lRest (Optional)
Type: Usual
TRUE processes only records from nStart to the end of the file. FALSE processes all records.

Return Value

Type: Logic
TRUE if successful; otherwise, FALSE.
Remarks
Tip Tip
The nNext, nRecord, and lRest arguments are mutually exclusive. You should not pass all three of them. And if you pass the cbWhile argument then this also controls the scope behavior.
DBAppSDF() is the functional equivalent of the APPEND FROM SDF command. It is the same as the DBApp() function except that it can be used only with SDF files. See APPEND FROM and DBApp() for more information.
Examples
The following example appends text from an SDF file:
X#
1USE test NEW
2DBAppSDF("srcsdf")
See Also