QReport "Query: Field 'id' not found"


2006-07-13 10:18:09 AM
cppbuilder105
Hi,
I have a TQuckRep component on a form. The following sumerises the setup:
Within form constructor:
Query1->Params->Items[0]->AsInteger=1;
On the form:
TQuickRep:
Name: TQ1
DataSet: Query2
TQuery:
Name: Query1
SQL: Select order from table1 where id= :var
TDataSouce:
Name: DS1
DataSet: Query1
TQuery:
Name: Query2
DataSouce: DS1
SQL: Select name_id, address from table2 where orderid=:order
The above setup has the Active's and DatabaseBaseName's set and the results
from Query2 are displayed within SubBands on the for as would be expected.
The problem comes when I add the following components and then set the
TQ1.DataSet to Query3:
TDataSouce:
Name: DS2
DataSet: Query2
TQuery:
Name: Query3
DataSouce: DS2
SQL: Select x, y from table3 where id= :name_id
The Actives all set to true indicating that the setup and variable names are
correct. The program compiles but when I go and display the report I get the
error message: "Query2: Field 'name_id' not found". If I replace :name_id
with a number, it all works OK. This has me somewhat perplexed. I am
obviously missing a setting somewhere but cannot find it. Any ideas or
suggestions would be much appreciated.
Regards,
David