select max(id) from 表名

解决方案 »

  1.   

    如果楼上的不能满足的话,你可以执行一次last操作,让光标到最后一行。
      

  2.   

    设置 ID字段的 identity (自动增量)属性为 Y在insert 一条新记录后,用
    select @@Identity as MaxID;
    来返回最新的记录的ID。
      

  3.   

    那如何选择当前id号呢? select id from 表名 ?
      

  4.   

    你说的意思好模糊,先用dim count as integer
    然后用count=ds.tables("Yourforum").rows.count-1
    再用ds.tables("yourforum").rows.item(count).item("id")
    就可以突得
      

  5.   

    one  select * from tablename  where id = select max(id) from tablename
    two select top 1 * from tablename  order by id desc