There is such a code.
procedure TForm1.FramePositionsAdd1ButtonAddClick(Sender: TObject);
var
Name: String;
begin
Name := FramePositionsAdd1.EditName.Text;
with FramePositionsAdd1.ADOQuery1 do
begin;
SQL.Clear;
SQL.Text := 'INSERT INTO Должности ' +
'(Наименование) ' +
'VALUES ' +
'(:title)';
Parameters.ParamByName('title').Value := Name;
ExecSQL;
end;
end;
The value is added to the database, but instead of FramePositionsAdd1.EditName.Text the string ADOQuery1 is added.
I tried to remove the Name variable. One line changes:
Parameters.ParamByName('title').Value := FramePositionsAdd1.EditName.Text;
And everything work correctly. What is the problem?