我的新增按钮连接的是敏感控件的TDataSetInsert.

解决方案 »

  1.   

    insert 应该是在当前指针位置添加的,怎么会这样,你试试insertrecord
      

  2.   

    不好意思,问题看错了!
    你是要到最后一行,我看错了!
    调用 last 就可以了!不用post 因为insert是添加空记录!改好了,再post吧
      

  3.   

    说实话,我还是不太明白你的意思!
    你如果要在最后添加的话,为什么不用Append 或者是appendrecord
      

  4.   

    在OnInsertBefore事件里加Dataset.Last就可以了。
      

  5.   

    不要用INSERT,用APPEND, 这样就能够自动定位到最后一个记录了.
      

  6.   

    用Append 或者是appendrecord
      

  7.   

    post以后
    ADODATASET.LAST;
      

  8.   

    再beforeinsert事件中写  Dataset。last;
      

  9.   

    先last一下
    然后
    dbgrid1.Refresh;
    刷新
      

  10.   

    TAdoQuery空间有:
    Searches the dataset for a specified record and makes that record the current record.Delphi syntax:function Locate(const KeyFields: String; const KeyValues: Variant; Options: TLocateOptions): Boolean; override;DescriptionCall Locate to search a dataset for a specific row and make it the current row.KeyFields is a string containing a semicolon-delimited list of field names on which to search.KeyValues is a variant that specifies the values to match in the key fields. If KeyFields lists a single field, KeyValues specifies the value for that field on the desired row. To specify multiple search values, pass a variant array as KeyValues, or construct a variant array on the fly using the VarArrayOf routine. For example:with ADOTable1 do
      Locate('Company;Contact;Phone', VarArrayOf(['Sight Diver', 'P', '408-431-1000']), [loPartialKey]);

    Options is a set that optionally specifies additional search latitude when searching on string fields. If Options contains the loCaseInsensitive setting, then Locate ignores case when matching fields. If Options contains the loPartialKey setting, then Locate allows partial-string matching on strings in KeyValues. If Options is an empty set, or if KeyFields does not include any string fields, Options is ignored.Locate returns true if it finds a matching row, and makes that row the current one. Otherwise Locate returns false.
      

  11.   

    with ADOTable1 do
      Locate('字段名1;字段名2;字段名3', VarArrayOf(['字段名1的值', '字段名2的值', '字段名3的值']), [loPartialKey]);