Problem with Insert and Select

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
joseprad
Posts: 4
Joined: Tue 03 Jul 2012 07:35

Problem with Insert and Select

Post by joseprad » Wed 24 Apr 2013 18:23

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

AndreyZ

Re: Problem with Insert and Select

Post by AndreyZ » Thu 25 Apr 2013 13:26

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.

Post Reply