寻求解决方案

shaolongli 2003-03-14 12:45:17
用Update更新的记录,我想立即去到其id值(是自动增长的),各位有什么好的方案?
...全文
32 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
shaolongli 2003-03-14
  • 打赏
  • 举报
回复
二楼的方法是可以,单当两个人同时进行操作的时候容易出错!
gotorun 2003-03-14
  • 打赏
  • 举报
回复
忘了加rs.addnew 了,不好意思,笔误

set rs=server.createobject("adodb.recordset")
sql="select * from table"
rs.open conn,sql,1,3
if rs.eof and rs.bof then
rs.addnew
rs("content")=content
rs.update
set rs1=conn.execute("select top 1 * from table order by id desc")
id=rs1(id)
其中id就是你要取的了
gotorun 2003-03-14
  • 打赏
  • 举报
回复
set rs=server.createobject("adodb.recordset")
sql="select * from table"
rs.open conn,sql,1,3
if rs.eof and rs.bof then
rs("content")=content
rs.update
set rs1=conn.execute("select top 1 * from table order by id desc")
id=rs1(id)
其中id就是你要取的了
hahu 2003-03-14
  • 打赏
  • 举报
回复
rs.open sql,conn,3,3
nowid=rs("id")
rs.addnew
rs("tem")=thevalue
rs.update
注意3,3
fj47 2003-03-14
  • 打赏
  • 举报
回复
如果表中还有一个不重复的字段就好办了

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧