用sql语句按id排序,填充数据集,取最后一条记录的id值就行了

解决方案 »

  1.   

    what version of Access are you using? if you are using Access 2000, you can select @@identity, also seeRetrieving Identity or Autonumber Values
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconRetrievingIdentityOrAutonumberValues.asp
      

  2.   

    http://expert.csdn.net/Expert/topic/2972/2972266.xml?temp=.4551355提问之前最好先搜索一下!;-)
      

  3.   

    写个存储过程把@@IDENTITY赋给值,在页面中接受就可以了
      

  4.   

    INSERT INTO jobs (job_desc,min_lvl,max_lvl)
    VALUES ('Accountant',12,125)
    SELECT @@IDENTITY 我用这个格式来返回怎么在执行的时候发生错误?(asp.net+access 2000)
     
    Message: 在 SQL 语句结尾之后找到字符。
    Native Error: -533204413
    Source: Microsoft JET Database Engine
    SQL State: 3000
     
      

  5.   

    学习从来都还没会用过select @@IDENTITY
    我以前都时这么做的:先用函数生成一个安全编号(其实有的时候也就时最大编号加一);然后插入记录(没有使用自动编号);
    现在要考虑一下新的方法了