Answer the question
In order to leave comments, you need to log in
Why does the SQL.active property need to be set to true to select a row in the database via TADOQuery, but not to insert it?
Hello. There is such a code.
procedure TFormMain.Button7Click(Sender: TObject);
begin;
FormMain.QueryOrganizer.SQL.Clear;
FormMain.QueryOrganizer.SQL.Text := 'INSERT INTO Органайзер ' +
'([Код поручения], [Код работника]) ' +
'VALUES ' +
'(1, 1)';
FormMain.QueryOrganizer.ExecSQL;
FormMain.QueryOrganizer.SQL.Clear;
FormMain.QueryOrganizer.SQL.Text := 'SELECT * FROM Органайзер;';
FormMain.QueryOrganizer.Active := true;
FormMain.QueryOrganizer.ExecSQL;
ShowMessage(FormMain.QueryOrganizer.FieldByName('Код').AsString);
FrameOrganizer1.DBGrid1.Datasource.Dataset.Close;
FrameOrganizer1.DBGrid1.Datasource.Dataset.Open;
end;
FormMain.QueryOrganizer.Active := true;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question