如何判断ADO数据集中是否有已经被删除的记录? 数据集 STATE方法不能判断,因为DELETE方法后数据集会已经进入dsBrowse状态,用RecordStatus好像也不能判断?

解决方案 »

  1.   

    ADO数据集指的是什么啊?是否有已经被删除的记录,已经删除的记录怎么还可以判断啊,你想实现什么功能呢
      

  2.   

    RecordStatus property (TCustomADODataSet)Indicates the status of the current row.Delphi syntax:property RecordStatus: TRecordStatusSetC++ syntax:__property TRecordStatusSet RecordStatus = {read=GetRecordStatus, nodefault};DescriptionRead RecordStatus to determine the status of the current row relative to batch updates or other bulk operations. Among other record state aspects, RecordStatus indicates whether the current record is new, modified, deleted, or unmodified. RecordStatus will also give an indication why a row is not saved when modifying, adding, or deleting data.type 
      TRecordStatus = (rsOK, rsNew, rsModified, rsDeleted, rsUnmodified, rsInvalid, rsMultipleChanges, rsPendingChanges, rsCanceled, rsCantRelease, rsConcurrencyViolation, rsIntegrityViolation, rsMaxChangesExceeded, rsObjectOpen, rsOutOfMemory, rsPermissionDenied, rsSchemaViolation, rsDBDeleted);
      TRecordStatusSet = set of TRecordStatus;通过RecordStatus可以判断当前记录是否是删除状态
      

  3.   

    Tclientdataset的DELTA属性可以包含所有修改过或者是删除的记录状态
      

  4.   

    delphi的帮助上写得很清楚,只有在batch update mode下RecordStatus才能表现出他的所有状态,其意义就是只有批更新方式下才能有删除状态~!
    其状态有以下几个枚举值:
    rsOK、rsNew、rsModified、rsDeleted、rsUnmodified、rsPendingChanges、rsCanceled等等,不再列举,详细查看delphi的帮助。