Subject TIB_Query and KeyLinks via Delphi Code
Author David Husarik
Hi Group;

I am getting the following error when I try to set
TIB_Query KeyLinks via code in Delphi.

Project __ raised exception class EIB_Error with
message 'Invalid KeyLink Entry' TBL_AK.AFF_CODE
Process stopped, Use step or Run to continue.

I am trying to do this in code because the user has
the ability to select from 52 tables and each table
has the same 3 search fields (ID, Name, City). It
would be difficult to arrange 156 TIB_Query Components
on a data module page. This is to get 9
TIB_LookupCombo Boxes to work.

Some of my code is as follows:

KL_Main : TIB_StringList;
...
tblName : string;
...
tblName := 'TBL_AK';
...
KL_Main := TIB_StringList.Create;
KL_Main.Add((tblName + '.AFF_CODE'));
KL_Main.Add((tblName + '.DEDUCT_CODE'));
KL_Main.Add((tblName + '.ORG_CODE'));
KL_Main.Add((tblName + '.OFFICE_CODE'));
KL_Main.Add((tblName + '.ASSET_CODE'));
KL_Main.Add((tblName + '.INCOME_CODE'));
KL_Main.Add((tblName + '.FILING_CODE'));
KL_Main.Add((tblName + '.ACCT_PRDS'));
KL_Main.Add((tblName + '.FOUND_CODE'));
...
mainDM.ibq_Main.KeyLinks := KL_Main;

This coding generates the error. I went to the help
file for TIB_StringList Object and now I am thoroughly
confused. Is the help file telling me that for each
keyLink entry, the following is required (using the
syntax from the help file)?

<link entry> ::= <link name>=<link value>
<link name> ::= [<table name>.] <column name>
<link value> ::= (<string literal>|<param list>)

What would be a valid code entry in Delphi?

KL_Main.Add((linkEntry1=linkName1=linkValue1));

where linkEntry1 is an arbitrary name,
linkName1 = affiliation = TBL_AK.
linkValue1 = AFF_CODE
all assigned to TStrings prior to the add procedure.

Any & all help is appreciated.
Thanks in advance,
David Husarik


__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com