TableNames

<< Click to Display Table of Contents >>

Navigation:  Apollo VCL Components > Apollo VCL Component Reference > TApolloQuery > TApolloQuery Properties >

TableNames

Declaration

property TableNames: TApolloTables;

Description

Allows the optional selection of specific tables within the directory referenced by the Database property. This list will be used to specify the TableType, Alias, OEMTranslate, and optional Password and/or ExtraIndexes of the tables to be used when the server evaluates the SQL expression.

 

This pre-definition of the tables should only be required when mixing tables of multiple types (for example, one FoxPro and one Clipper) within the same SQL expression. Also, when using multiple encrypted tables that each use a different password. Similarly, for multiple tables that use a different OEMTranslate setting or that contain single-order (.NTX or .IDX) indexes that need defining in the ExtraIndexes property (to be used in query optimization).

 

image\TableNames256.gif

 

By default, if not explicitly defined here, table names are assumed to be the alias used within the SQL expression with a standard .DBF extension. For example, if you do not define any TableNames here, and issue a statement such as SELECT * FROM Test, it will be assumed that a table called TEST.DBF exists in the directory associated with the TApolloQuery.DatabaseName value. The table's type (FoxPro, Clipper, or HiPer-SIx) will be assumed to be that set in the TApolloQuery.TableType property.

 

Alias indicates the name to be used in the SQL statements. For example, the table name might be CUSTOMERS.DBF, but you can specify a shorter Alias value of CUST, if you'd like to use a statement like: SELECT * from CUST, instead of the default Alias of CUSTOMERS, where you would use: SELECT * FROM CUSTOMERS.

 

ExtraIndexes is used to specify single-order or non-structural indexes that are to be opened and closed automatically as the table is opened and closed. See the TApolloTable.ExtraIndexes property for more details.

 

Password is for use on tables that have been previously encrypted using TApolloTable.DBFEncrypt.

 

OEMTranslate handles automatically translating record buffers stored in the OEM character set to Windows ANSI. The default is False. See OEMTranslate for more details on the effects of this setting.

 

TableName is the actual name of the table as it is called on the server (ex: CUSTOMERS.DBF).

 

TableType is the table type to be used on the server to open this table. See TableType for details.

Delphi Example

var

 t1 : TApolloTableItem; 

begin

 t1 := ApolloQuery1.TableNames.Add;

 t1.TableName := 'TEST.DBF'; 

 t1.Alias := 'TEST'; 

 t1.Password := 'SeCrEt'; 

 t1.OEMTranslate := False; 

 t1.TableType := ttSXNSX; 

 . . . 

See Also

ActiveTApolloQuery_Active, OpenOpen, ExecSQLExecSQL, Apollo SQL Overview!JumpID(`APOLLOSQL.HLP',`ApolloSQL_Overview')