我曾经在ASP里实现过,希望能给你启发
'添加服务卡号
'cardId:关键值,引用
set rs1=server.createobject("adodb.recordset")
sq2="select * from servCard"
rs1.open sq2,conn,1,3
rs1.addnew
rs1("custId")=request.form("tid")
rs1("serCardNo")=request.form("cardNO")
rs1("purchMoney")=request.form("deposit")
rs1("PurchID")=PurchaseID
rs1.update
dim servID,temp1
temp1 = rs1.bookmark
rs1.bookmark = temp1
servID=rs1.Fields("cardId").Value
Response.write servID&"</br>" '测试返回当前纪录ID