BtServer:DbStruct Access

 

<< Click to Display Table of Contents >>

Navigation:  Server Classes > BtServer Class >

 

BtServer:DbStruct Access

 

Previous pageReturn to chapter overviewNext page

 

Purpose

 

 

Return the structure of the table in a VO structure array

 

 

 

Prototype

 

 

ACCESS DbStruct CLASS BtServer

 

 

 

Return

 

 

ARRAY                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.

 

 

 

Description

 

 

This method returns the structure of the Btrieve table in the form of a VO structure array Each subarray is comprised of four elements, which contain the following information, in this order:

Constant                Attribute

DBS_NAME                cName

DBS_TYPE                cType

DBS_LEN                nLength

DBS_DEC                nDecimals

 

 

 

 

Example(s)

 

 

This example opens a database file, then creates an array containing the database

structure using DBServer:DBStruct within an aliased expression.  The field names

are then listed using AEval():

CLASS Sales INHERIT BtServer

...

FUNCTION StructDemo()

LOCAL aStruct AS ARRAY, oDBSales AS DBServer

oDBSales := Sales

aStruct := oDBSales:DBStruct

AEval(aStruct, |aField|QOut(aField[DBS_NAME]))

 

 

 

 

See Also

 

 

BtServer, BtServer:FCount, BtServer:FieldName()