FilterAlias

<< Click to Display Table of Contents >>

Navigation:  Apollo VCL Components > Apollo VCL Component Reference > TApolloTable > TApolloTable Methods >

FilterAlias

Declaration

function FilterAlias( sAliasName, sFieldName: String ): WordBool;

Description

Assigns an alias name to a field name in the table to be used in an upcoming FilterDlg call. If an alias list is created with this function, only those fields defined with an alias will be shown in the FilterDlg Fields List Box., and the Fields List Box will refer to a field by its alias name first.

 

FilterDlg creates a filter builder dialog box that allows your users to construct filter expressions that apply to the current table. The use of alias field names allows the applications programmer to redefine cryptic table field names with a moniker that the casual user might understand.

 

To create a list of alias/field names, call this function repeatedly for each field you wish to display in the FilterDlg Fields List Box.

 

image\tip.gif This method is not supported under remote tables using Apollo Database Server.

Parameters

sAliasName: The alternate field name. Maximum length is 15 characters.

sFieldName: The actual field name.

Return Value

True if the field was found. False if an error was encountered.

image\tip.gif The list of alias names is automatically destroyed after calling FilterDlg.

Delphi Example

 

// User filter setting

procedure Form1.Button1Click(Sender: TObject);

var

 cString: String; 

begin

// Set up alias names

with ApTbl do

begin 

FilterAlias( 'LastName', 'last' );

FilterAlias( 'FirstName', 'first' ); 

FilterAlias( 'Address', 'add1' ); 

FilterAlias( 'City', 'add2' ); 

FilterAlias( 'State', 'add3' ); 

 

 // Display filter dialog box with field aliases

cString := FilterDlg( self.Handle, '', 'Amazo-App', True ); 

 

 // Set Query

Query( cString ); 

end; 

end;

See Also

FilterDlg, Query