Click or drag to resize

ADBObjects Function

X#
-- todo --
Places the names of named connections, relations, tables, or SQL views in the current database into a variable array.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax
 FUNCTION ADBObjects(
	ArrayName,
	cSetting
) AS USUAL CLIPPER
Request Example View Source

Parameters

ArrayName (Optional)
Type: Usual
Specifies the name of the array in which the names are placed.
cSetting (Optional)
Type: Usual
Specifies the names to place in the variable array. The table in the remarks section lists the values for cSetting and the corresponding names placed in the array:

Return Value

Type: Usual
Numeric
Remarks
A database must be open and current when ADBObjects( ) is issued; otherwise X# generates an error message.
ValueName placed in array
ConnectionConnection names
RELATIONTable relationships
TableTable names
ViewView names
The Connection, Relation, Table, and View settings cannot be abbreviated.

ArrayName: If the array you specify doesn't exist, X# automatically creates the array. If the array exists and isn't large enough to contain all the names, X# automatically increases the size of the array to accommodate the names. If the array is larger than necessary, X# truncates the array. If the array exists and ADBObjects( ) returns 0 because no names are found, the array remains unchanged. If the array doesn't exist, and ADBObjects( ) returns 0, the array is not created.

A one-dimensional array is created when you specify Connection, Table, or View for cSetting. Each row in the one-dimensional array contains the name of a connection, table, or view in the database.
A two-dimensional array is created when you specify Relation for cSetting. Each row in the two-dimensional array corresponds to a relationship in the database. The first column in an array row contains the name of the child table and the second column in an array row contains the name of the parent table. The third column contains the name of the index tag for the child table and the fourth column contains the name of the index tag for the parent table.
The fifth column in an array row contains referential integrity information. This column is empty if the relation has no referential integrity rules. If the relationship does have referential integrity rules, the column contains characters corresponding to the type of referential integrity rules for updates, deletions, and insertions.
The first character indicates the type of update rule, the second character indicates the type of deletion rule, and the third character indicates the type of insertion rule.
Possible values for updates and deletions are "C" for cascade, "R" for restrict, and "I" for ignore. Possible values for insertions are "R" for restrict, and "I" for ignore. For example, if a relation has cascaded updates, restricted deletions, and ignores insertion referential integrity rules, the column contains "CRI".
Examples
X#
 1* Close any open databases
 2Close Databases
 3* Clear desktop to prepare for displaying the array
 4Clear
 5* Open sample testdata database
 6Open Database (HOME(2) + 'Data\testdata')
 7* Function call with cSetting for table names
 8=ADBObjects(gaTables, "Table")
 9* Displays array gaTables created by ADBObjects( ) function
10Display MEMORY LIKE gaTables
See Also