第一種:直接sql語句解決
conn.Execute "insert into tbl(a) values('aaa')"
' 此間保證 conn 沒有 close() 沒有再插入其它數(shù)據(jù)Set rs = conn.Execute("select @@identity as NewID"
第二種:
rs.addnew
rs("yhm")=yhm
rs("mm")=mm
rs("sfsh")="未審核"
rs("tjsj")=now
rs("hyjb_id")=hyjb_id
rs("sjh")=sjh
rs("xm")=xm
rs("xm")=xm
rs("yqm")=yqm
rs("sfzh")=sfzh
rs("scsfzzp")=scsfzzp
rs("sj_id")=sj_id
rs.update
newID=rs("id")
response.Write newID