日期:2010-02-21  浏览次数:20836 次

ACCESS库可以这样书写:
set rs = server.createobject("adodb.recordset")
sql = "select * from news"
rs.addnew
rs("title") = "测试"
rs("content") = "内容"
rs.update
newid = rs("id")
rs.close

SQLSERVER用上面的方法不行,必须在UPDATE后多加一句,rs.movelast.
set rs = server.createobject("adodb.recordset")
sql = "select * from news"
rs.addnew
rs("title") = "测试"
rs("content") = "内容"
rs.update
rs.movelast
newid = rs("id")
rs.close