What is this????

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
dragan
Posts: 3
Joined: Thu 11 Aug 2005 10:29

What is this????

Post by dragan » Thu 11 Aug 2005 11:20

In delphi code i am have:

qryT := TMSQuery.Create(self);
qryT.Connection := dmCS.databaseCS;

qryT.Close;
qryT.SQL.Clear;
qryT.sql.add('select * from tabela');
qryT.open;
qryT.edit;
qryT.fieldbyname('gaga').asstring:='A';
qryT.post;

and........Message:
Update failed, found 2 row.

Why???????? All is corect. This is worked with Dao components and with Microsoft Jet. Why dont work with SDAC.
i havedelphi 6.0 sdac 3.55.0.16 and SqlServer 2000

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Fri 12 Aug 2005 07:45

We cannot reproduce this problem with your example. Please check that table did not contain duplicate rows before.

dragan
Posts: 3
Joined: Thu 11 Aug 2005 10:29

Post by dragan » Fri 12 Aug 2005 08:55

Paul wrote:We cannot reproduce this problem with your example. Please check that table did not contain duplicate rows before.
Only one row.
Here is pure procedure

procedure TfrmGlavniMeniCS.Button1Click(Sender: TObject);
var qryT: TMSQuery;
begin
qryT := TMSQuery.Create(self);
qryT.Connection := dmCS.databaseCS;
qryT.SQL.Add(' SELECT top 1 * ');
qryT.SQL.Add(' FROM tabela');
qryT.Open;
qryT.Edit;
qryT.FieldByName('gaga').AsFloat := 10;
qryT.Post;
end;


Only one row.

and........Message:
Update failed, found 2 records

if i write:

update tabela set gaga=10 where .....

this work

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Fri 12 Aug 2005 11:50

I can reproduce this problem when I open Enterprise Manager and add duplicate row equivalent to the first one in the table "tabla". Than when I press TfrmGlavniMeniCS.Button1Click I receive this error message. When I execute "update tabela set gaga=10 where ..." this error does not occur, because SDAC does not perform any checking for direct executions.
What rows do you have in table "tabla"? What version of SDAC do you use?

Post Reply