<< Click to Display Table of Contents >> Navigation: Apollo VCL Components > Apollo VCL Component Reference > TApolloTable > TApolloTable Methods > KeyAdd |
Declaration
function KeyAdd( sTagName : String ): WordBool;
Description
Adds a key to the specified index order.
This method can only be used on SDEFOX or SDENSX indexes that were created using the IDX_EMPTY constant for the iOption parameter of Index or IndexTag.
Return Value
True if the key was successfully added, False if not.
Delphi Example
with ApTbl do
begin
Open;
Index( 'test.idx', 'upper(STATE)+upper(CITY)', IDX_EMPTY, False, '' );
SetOrder( 0 );
GoTop;
if KeyAdd( 'test.idx' ) then
ShowMessage( 'Key added successfully.' )
else
ShowMessage( 'Key add failed!' );
end;
C++Builder Example
ApTbl->Open();
ApTbl->Index( "test.idx", "upper(STATE)+upper(CITY)", IDX_EMPTY, false, NULL );
ApTbl->SetOrder( 0 );
ApTbl->GoTop();
if (ApTbl->KeyAdd( "test.idx" ))
ShowMessage( "Key added successfully." );
else
ShowMessage( "Key add failed!" );
See Also