Answer the question
In order to leave comments, you need to log in
How to compose an SQL query, correctly for declaring data in the *dbf database?
People help to make SQL - request correctly if I write thus the code:
dmContanierIcon.quAdmissionProduct.Active := False;
dmContanierIcon.quAdmissionProduct.Close;
dmContanierIcon.quAdmissionProduct.SQL.Clear;
dmContanierIcon.quAdmissionProduct.SQL.Text := 'UPDATE dbt_AdmissionProduct SET p_id = '+IntToStr(varFirstRecId)+' WHERE p_product = "'+varArticleUpdateId+'"';
dmContanierIcon.quAdmissionProduct.ExecSQL;
//dmContanierIcon.quAdmissionProduct.Open;
dbgrdAdmissionProduct.DataSource.DataSet.Next;
I get the following error:
what if I uncomment
dmContanierIcon.quAdmissionProduct.Open;
trail comes out. mistake:
please tell me how to do it right ... Thank you.
Answer the question
In order to leave comments, you need to log in
well firstly
dmContanierIcon.quAdmissionProduct.SQL.Text := 'UPDATE dbt_AdmissionProduct SET p_id = '+IntToStr(varFirstRecId)+' WHERE p_product = "'+varArticleUpdateId+'"';
it would be more correct to write it as:
dmContanierIcon.quAdmissionProduct.SQL.Text := UPDATE dbt_AdmissionProduct SET p_id = :varFirstRecId WHERE p_product = :varArticleUpdateId;
dmContanierIcon.quAdmissionProduct.ParamByName('varFirstRecId').AsInteger := varFirstRecId;
dmContanierIcon.quAdmissionProduct.ParamByName('varArticleUpdateId').AsString := varArticleUpdateId;
dmContanierIcon.quAdmissionProduct.ExecSQL;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question