意思如下:
if {table in edit mode} then......
if {table in insert mode} then.......

解决方案 »

  1.   

    可不可以在Edit和Post之间加个标记?
    可使用SQL提交怎么办?InTransaction?
    你的目的是什么?
    说出来,看看有没有别的解决方案?
      

  2.   

    TDataSetState = (dsInactive, dsBrowse, dsEdit, dsInsert, dsSetKey, dsCalcFields, dsFilter, dsNewValue, dsOldValue, dsCurValue);
    property State: TDataSetState;
    //
    if table1.state=dsEdit then
    ....
    if table1.state=dsInsert then
    ...
      

  3.   

    to 楼上。我以前还不知道呢?谢谢
    to 搂主。 例子如下:procedure TForm1.AppendNoteClick(Sender: TObject);var
      Stream: TStream;
      S: string;
    begin
      with Tasks do
      begin    Edit;    if State = dsEdit then
        begin
          Stream := CreateBlobStream(FieldByName('Notes'), bmReadWrite);
          try
            Stream.Seek(0, 2); {Seek 0 bytes from the stream's end point}
            S := ' This line will be added to the end.';
            Stream.Write(PChar(S)^, Length(S));
            Post;
          finally
            Stream.Free;
          end;
        end;
      end;
    end;
      

  4.   

    这个问题其实很简单,现代码如下:
    if table.state=dsinsert then//如果表处在插入状态
    begin
      执行代码
    end;
    if table.state=dsedit then//如果表处在编辑状态
    begin
      执行代码
    end;
      

  5.   

    DataSource组件有个State属性。
    此State的属性值的类型如下:
    type  TDataSetState = (dsInactive, dsBrowse, dsEdit, dsInsert, dsSetKey, dsCalcFields, dsFilter, dsNewValue, dsOldValue, dsCurValue);可根据此属性来进行判断:
    if DataSource.Satae = dsEdit then
    ......
    if DataSource.Satae = dsInsert then
    ......
      

  6.   

    [Error] UntDkqk.pas(356): Undeclared identifier: 'dsEdit'
      

  7.   

    或者用in [dsEdit, dsInsert]也可以的,呵呵