아래와 같이 하여 쿼리를 이용하여 테이블에 레코드를 집어넣고 싶습니다.
근데 항상에러가 나오네요.
방법이 없을까요?
procedure TWH11Form.AddClick(Sender: TObject);
begin
WH11AddMod := TWH11AddMod.Create(nil);
if WH11AddMod.ShowModal = mrOK Then
if true Then
Begin
query1.Close;
query1.sql.Clear;
query1.SQL.Add('Insert into wh11 (Place,PalletNo,Itemcode,GrpName,Spec,Qty,Class,Remark) Values( :Place,:PalletNo,:Itemcode,:GrpName,:Spec,:Qty,:Class,:Remark)');
query1.ParamByName('Place').AsString := WH11AddMod.Edit1.Text;
query1.ParamByName('PalletNo').AsString :=WH11AddMod.Edit2.Text;
query1.ParamByName('ItemCode').AsString := WH11AddMod.Edit3.Text;
query1.ParamByName('GrpName').AsString := WH11AddMod.Edit4.Text;
query1.ParamByName('Spec').AsString := WH11AddMod.Edit5.Text;
query1.ParamByName('Qty').AsString := WH11AddMod.Edit6.Text;
query1.ParamByName('Class').AsString := WH11AddMod.COMBOBOX1.Text;
query1.ParamByName('Remark').AsString := WH11AddMod.Edit8.Text;
query1.EXECSQL;
// query1.OPEN;
{ WH11Form.Query1.Close;
WH11Form.Query1.SQL.Clear;
WH11Form.Query1.SQL.ADD('select * from WH11.dbf ');
WH11Form.Query1.SQL.ADD('Order by Place');
WH11Form.Query1.Open; }
{WH11.Append;
WH11.FieldByName('Place').AsString := WH11AddMod.Edit1.Text;
WH11.FieldByName('PalletNo').AsString :=WH11AddMod.Edit2.Text;
WH11.FieldByName('ItemCode').AsString := WH11AddMod.Edit3.Text;
WH11.FieldByName('GrpName').AsString := WH11AddMod.Edit4.Text;
WH11.FieldByName('Spec').AsString := WH11AddMod.Edit5.Text;
WH11.FieldByName('Qty').AsString := WH11AddMod.Edit6.Text;
WH11.FieldByName('Class').AsString := WH11AddMod.COMBOBOX1.Text;
WH11.FieldByName('Remark').AsString := WH11AddMod.Edit8.Text;
WH11.Post;
WH11Form.Query1.Close;
WH11Form.Query1.SQL.Clear;
WH11Form.Query1.SQL.ADD('select * from WH11.dbf ');
WH11Form.Query1.SQL.ADD('Order by Place');
WH11Form.Query1.Open; }
End;
end;