Page 1 of 1

Problem with Insert and Select

Posted: Wed 24 Apr 2013 18:23
by joseprad
Hello friends:

I have a problem and I can not solve.
I need to insert a record and read the table below to see a TDBLockupComboBox.
For this I use the following code to insert:
with FxEx.msqFabricants do begin
Close;
SQL.Clear;
SQL := SQLInsert;
ParamByName('NomFabricant').AsString := edtCrear.Value;
ParamByName('Codi').AsInteger := Codi;
ParamByName('Referencia').AsString := edtReferencia.Value;
Execute;
end;
and try to read the table with:
with FxEx.msqFabricants do begin
Close;
SQL.Clear;
SQL := SQLRefresh;
Open;
end;
SQLRefresh = Select * FROM tblFabricants.
but returns nothing

I use Delphi 2010 in Windows 7 and SDAC 7,5
thank you very much

Re: Problem with Insert and Select

Posted: Thu 25 Apr 2013 13:26
by AndreyZ
Hello,

I cannot reproduce the problem. Please try using the following code:

Code: Select all

with FxEx.msqFabricants do begin
  Close;
  SQL.Clear;
  SQL := SQLRefresh;
  Open;
  ShowMessage(IntToStr(RecordCount));
end;
Does the message return a value more than 0? If not, please try creating a small sample to demonstrate the problem and send it to andreyz*devart*com , including the script to create the tblFabricants table.