select top 1 * from table where [user]='me' order by writtendate desc

解决方案 »

  1.   

    sql server中:
    declare @id int
    select @id=@@identity
      

  2.   

    用ADO,静态客户端游标,批处理锁.
    下面是例子:
    With DBRecordset
         .CursorType = adOpenStatic
         .CursorLocation = adUseClient
         .LockType = adLockBatchOptimistic
         ...
         ...
         .Open
         .AddNew
         ... 
         ...
         .UpdateBatch
         debug.print .Fields!ID
         .close   
    end with