>Dear Experts
>
>I have a table entitled TABLE2 contained three character type fields. On click event of command1, I have following codes
>
>SELECT table2
>INDEX ON ALLTRIM(mill)+ALLTRIM(bank)+ALLTRIM(branch) TO table21
>
>When I press command1, it shows following error message
>
>"Invalid key length"
>
>What is problem?
>How should I create this index?
>
>Please help
Tariq, don't use ALLTRIM() into a index key;
only with strange graph structures this can to be useful.
EXAMPLE:
mill,bank,brancH
' AB ',' CD ',' E ' => KEY:'ABCDE'
' A ',' BC ',' DE ' => KEY:'ABCDE'
Error occur because VFP evaluate the key expression for to compute the key lenght;
If this is not the max lenght case, a next key fire the error.
use:
mill+bank+branch
or ( !!!! i think you don't want this really )
mill-bank-branch
or
PADR(ALLTRIM(mill)+ALLTRIM(bank)+LTRIM(branch),millfsize+bankfsize...)