Page 1 of 1

Update failed SDAC

Posted: Fri 19 Aug 2005 09:39
by Doca
In delphi code i am have:
///

on dfm file query qryPopraviPromet is

object qryPopraviPromet: TwwMSQuery
Connection = dmDK.databaseDK
SQL.Strings = (
'SELECT DatumZaEvidencne FROM DKPromet '
'WHERE ZaporednaStevilkaPrometa= :pZap;')
ValidateWithMask = True
Left = 448
Top = 208
ParamData =
object qryPopraviPrometDatumZaEvidencne: TDateTimeField
FieldName = 'DatumZaEvidencne'
end
end
///

in pas file


procedure TfrmNastavitveKnjizVknjizbEvidKontov.PopraviPrometniZapis(nZap: integer);
// 11.1.2001 dodali popravljanje izvornega zapisa v DKPromet-u
begin
with qryPopraviPromet do
try
Close;
Connection:= dmDK.databaseDK;
SQL.Clear;
SQL.Add('SELECT DatumZaEvidencne FROM DKPromet');
SQL.Add('WHERE ZaporednaStevilkaPrometa=:pZapStev ');

// ZaporednaStevilkaPrometa (PrimaryKey (No Duplicates))

ParamByName('pZapStev').AsInteger := nZap;
Open;
lFound := not (BOF and EOF);
if not lFound then
begin
Beep;
MessageDlg(MLFormat('Napaka 875 - Modul Popravljanja prometnega zapisa;' + #13 + 'Zapisa z zap.številko ' +
' %s ni, čeprav bi moral biti!', [IntToStr(nZap)]), mtError, [mbOk], 0);
end
else
begin // Recordcount=1
Edit;
FieldByName('DatumZaEvidencne').AsDateTime := Now;
Post;
//
end;
Close;
except
on E: Exception do
t_DoException('Napaka pri ažuriranju DKPrometa!', E.Message, nil);
end;
end;


On post is error
Update failed, found 9 record...

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: Mon 22 Aug 2005 08:17
by Ikar
This error message raises when on executing, for example, UPDATE statement several rows in the table were modified at the server. In most cases such situations happen if in the modified table there is no unique key field or this field is not included into SELECT statement. Also you can turn off this message. Please refer to help TCustomMSDataSet.Options.StrictUpdate for details.