Re: Currency Fields In Dynamic ADO Queries




Now, the following code will execute correctly, if the dynamic SQL
statement contains only the fields that are shown in the Fields Editor.
The problem is that a seperate ADOQuery comp. and Datasource comp. must
be used, whenever I want a query with different fields and/or table. Is
there a simpler way that uses an ADOQuery component?

You can create persistent Tfields at runtime

var
f : TField;
i : integer;
begin
Query1.FieldDefs.Update
Query1.Close;
for i := 0 to Query1.FieldDefs.Count - 1 do
//create persistent field that do not exist
if Query1.FindField(Query1.FieldDefs[i].Name) = nil then
Query1.FieldDefs.Items[i].CreateField(Query1);

end;
--
Brian Bushay (TeamB)
Bbushay@xxxxxxxxx
.