一、ACCESS中,直接取
set rs=server.createobject("ADODB.recordset")
sql = "select * from aa"
rs.Open sql,conn,1,3
rs.addnew
rs("title")=trim(title)
……
rs.update
id1=rs("id")
rs.close
二、MSSQL有2种方法可实现,直接取为空
1.插入后按id降序,再取
set rs=server.createobject("ADODB.recordset")
sql = "select * from aa"
rs.Open sql,conn,1,3
rs.addnew
rs("title")=trim(title)
……
rs.update
rs.close
sql = "select top 1 * from aa order by id desc"
rs.Open sql,conn,1,1
id1=rs("id")
rs.close
2.游标移动到最后,再取
set rs=server.createobject("ADODB.recordset")
sql = "select * from aa"
rs.Open sql,conn,1,3
rs.addnew
rs("title")=trim(title)
……
rs.update
rs.movelast
id1=rs("id")
rs.close