I need my user to input a value into a textbox and when the button is pressed it will insert that value into my db.
It gives erros and I have tried a number of different ways but to no avail. Any pointers or help would be gratefully taken on board.
TIA
Code:
procedure TForm1.Button1Click(Sender: TObject);
begin
ADOQuery1.Active := false;
ADOQuery1.Sql.Clear;
ADOQuery1.Sql.Text := ('INSERT INTO tblStock(reagname) VALUES (' + QuotedStr(Edit1.Text) + ')');
ADOQuery1.ExecSQL;
ADOQuery1.Active := true;
end;
It gives erros and I have tried a number of different ways but to no avail. Any pointers or help would be gratefully taken on board.
TIA