Subject | Re: [IBO] problems with SQL query |
---|---|
Author | Dmitry Beloshistov |
Post date | 2004-07-29T10:00:21Z |
Hello, petesouthwest!
You wrote to <IBObjects@yahoogroups.com> on Thu, 29 Jul 2004 10:02:26 +0100:
p> queryString:='SELECT e.* FROM employee e JOIN project1 p1 ON p1.empNo
p> = e.emp_no WHERE p1.empNo= :empNo and p1.projectno= :projectno'
p> with datamodule2.qryFBAll do begin if not
p> Prepared then Prepare;
p> if Active then Close;
p> Params['empNo'].AsString := form1.DBEdit3.Text;
p> Params['projectno'].AsString :=form1.cmbModule.text;
p> sql.Clear;
p> sql.add(queryString);
p> open;
p> end;
Brrr....What is this?-))) Use instead these:
queryString:='SELECT e.* FROM employee e JOIN project1 p1 ON p1.empNo
= e.emp_no WHERE p1.empNo= :empNo and p1.projectno= :projectno'
with DataModule2.qryFBAI do
begin
Close; Sql.Clear;
sql.Text:=QueryString;
Prepare; // now we can get parameters from query
ParamValues['empNo']:=Form1.DBEdit3.Text;
ParamValues['projectno']:=Form1.cmbModule.Text;
Open;
end;
WBR, Dmitry Beloshistov AKA [-=BDS=-]
You wrote to <IBObjects@yahoogroups.com> on Thu, 29 Jul 2004 10:02:26 +0100:
p> queryString:='SELECT e.* FROM employee e JOIN project1 p1 ON p1.empNo
p> = e.emp_no WHERE p1.empNo= :empNo and p1.projectno= :projectno'
p> with datamodule2.qryFBAll do begin if not
p> Prepared then Prepare;
p> if Active then Close;
p> Params['empNo'].AsString := form1.DBEdit3.Text;
p> Params['projectno'].AsString :=form1.cmbModule.text;
p> sql.Clear;
p> sql.add(queryString);
p> open;
p> end;
Brrr....What is this?-))) Use instead these:
queryString:='SELECT e.* FROM employee e JOIN project1 p1 ON p1.empNo
= e.emp_no WHERE p1.empNo= :empNo and p1.projectno= :projectno'
with DataModule2.qryFBAI do
begin
Close; Sql.Clear;
sql.Text:=QueryString;
Prepare; // now we can get parameters from query
ParamValues['empNo']:=Form1.DBEdit3.Text;
ParamValues['projectno']:=Form1.cmbModule.Text;
Open;
end;
WBR, Dmitry Beloshistov AKA [-=BDS=-]