R royhgf Unregistered / Unconfirmed GUEST, unregistred user! 2008-09-02 #1 客户端可以applyupdates(0),但是就是当有错误发生时(比如数据库中存在相同记录,或者几个人同时更新记录)系统无法捕捉到,仍然提示成功,请问如何确定数据提交成功,请给出简单的例子.
Y ycluo Unregistered / Unconfirmed GUEST, unregistred user! 2008-09-03 #2 applyupdates(0)返回值为0表明保存成功!否则就失败
R royhgf Unregistered / Unconfirmed GUEST, unregistred user! 2008-09-03 #3 返回值有哪些,分别代表什么,我希望根据返回值提示用户哪里出错!!!
Y ycluo Unregistered / Unconfirmed GUEST, unregistred user! 2008-09-03 #4 出错代码就要在cds的事件onReconcileError中取得,如: ErrorMsg:=E.Message;<br> ErrorCode:=E.ErrorCode;
L levi Unregistered / Unconfirmed GUEST, unregistred user! 2008-09-03 #5 {*******************************************************}<br>{ }<br>{ Delphi Visual Component Library }<br>{ ClientDataSet Standard Reconcile Error Dialog }<br>{ }<br>{ Copyright (c) 1998 Borland International }<br>{ }<br>{*******************************************************}<br><br>{ Note: To use this dialog you should add a call to HandleReconcileError in<br> the OnReconcileError event handler of TClientDataSet (see the Client dataset<br> demos for an example). Also, after adding this unit to your project you must<br> go into the Project Options dialog and remove this form from the list of<br> Auto-created forms or an error will occur when compiling. }<br><br>unit DataSetError;<br><br>找到 Delphi自已提供的 dataSetError.pas单元,照上面的用法,在<br>ClientDataSet.OnReconcileError事件中写下就可以了,什么错误,怎么处理都一目了然<br> Action := DataSetError.HandleReconcileError(DataSet,UpdateKind, E);
{*******************************************************}<br>{ }<br>{ Delphi Visual Component Library }<br>{ ClientDataSet Standard Reconcile Error Dialog }<br>{ }<br>{ Copyright (c) 1998 Borland International }<br>{ }<br>{*******************************************************}<br><br>{ Note: To use this dialog you should add a call to HandleReconcileError in<br> the OnReconcileError event handler of TClientDataSet (see the Client dataset<br> demos for an example). Also, after adding this unit to your project you must<br> go into the Project Options dialog and remove this form from the list of<br> Auto-created forms or an error will occur when compiling. }<br><br>unit DataSetError;<br><br>找到 Delphi自已提供的 dataSetError.pas单元,照上面的用法,在<br>ClientDataSet.OnReconcileError事件中写下就可以了,什么错误,怎么处理都一目了然<br> Action := DataSetError.HandleReconcileError(DataSet,UpdateKind, E);
L lngdtommy Unregistered / Unconfirmed GUEST, unregistred user! 2008-09-03 #6 if ClientDataSet.applyupdates(0) > 0 then<br> raise Exception.Create('数据提交失败!');