Page 1 of 1

What is this????

Posted: Thu 11 Aug 2005 11:20
by dragan
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

Posted: Fri 12 Aug 2005 07:45
by Paul
We cannot reproduce this problem with your example. Please check that table did not contain duplicate rows before.

Posted: Fri 12 Aug 2005 08:55
by dragan
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

Posted: Fri 12 Aug 2005 11:50
by Paul
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?