selas
asked on
how to add all fields to query programicaly?
i'm using this query:
AdoQuery1.SQL.Clear;
AdoQuery1.SQL.Add('select krupje, laikas, skirtumas, viso from chipsai where laikas > '+QuotedStr(DatetoStr(Date TimePicker 1.Date - 1))+' order by laikas');
AdoQuery1.Open;
and i want to clear old field
and to add these fields to query programicaly like in fields editor
AdoQuery1.SQL.Clear;
AdoQuery1.SQL.Add('select krupje, laikas, skirtumas, viso from chipsai where laikas > '+QuotedStr(DatetoStr(Date
AdoQuery1.Open;
and i want to clear old field
and to add these fields to query programicaly like in fields editor
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you have a problem with assigning the condition in the clause WHERE:
.... WHERE LAIKAS > ' + QuotedStr(DatetoStr(DateTi mePicker1. Date - 1)) ....
you may use a parameter:
AdoQuery1.SQL.Active := False;
AdoQuery1.SQL.Text := 'select krupje, laikas, skirtumas, viso from chipsai where LAIKAS > :PRM_LAIKAS order by laikas';
AdoQuery1.Parameters.Param ByName('PR M_LAIKAS') .Value := TDateTime(DateTimePicker1. Date - 1);
AdoQuery1.SQL.Active := True;
.... WHERE LAIKAS > ' + QuotedStr(DatetoStr(DateTi
you may use a parameter:
AdoQuery1.SQL.Active := False;
AdoQuery1.SQL.Text := 'select krupje, laikas, skirtumas, viso from chipsai where LAIKAS > :PRM_LAIKAS order by laikas';
AdoQuery1.Parameters.Param
AdoQuery1.SQL.Active := True;
let
> AdoQuery1.SQL.Active := .... // True or False;
to be
AdoQuery1.Active := .... // True or False;
sorry ....
> AdoQuery1.SQL.Active := .... // True or False;
to be
AdoQuery1.Active := .... // True or False;
sorry ....
AdoQuery1.SQL.Text := 'select krupje, laikas, skirtumas, viso from chipsai where laikas > '+QuotedStr(DatetoStr(Date
AdoQuery1.SQL.Active := True;
//....
Using:
AdoQuery1.SQL.Text := ....;
you clear whole old content and replace with new one