关于取ID 的问题!

zq8888 2003-06-09 10:29:40
sql="select * from data"
rs.open sql,conn,1,3
rs.addnew
rs("model")=model
rs("fylx")=fylx
rs("qy")=quyu
rs("diduan")=diduan
rs("dz")=dz
rs("house_name")=house_name
rs("catlog")=catlog
rs("house_area")=house_area
rs("total_layer")=total_layer
rs("layer_no")=layer_no
rs("orient")=orient
rs("other_notes")=other_notes
rs("price")=price
rs("unit")=unit
rs("price_add")=price_add
rs("payment")=payment
rs("house_loan")=house_loan
rs("house_right")=houseright
rs("house_one")=house_one
rs("house_two")=house_two
rs("house_three")=house_three
rs("fs1")=fs1
rs("fs2")=fs2
rs("fs3")=fs3
rs("admin")=admin
rs("comment")=comment
rs("conman")=conman
rs("contel")=contel
rs.update
iid=rs("id")
custid=iid+10000

response.write rs("id")
rs.close
response.end
sql="select * from data where id="&iid
rs.open sql,conn,1,3
rs("custid")=custid
rs.update
rs.close
为什么取不到ID呢?
...全文
31 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
zq8888 2003-06-09
  • 打赏
  • 举报
回复
to:forestyang(forestyang)
select id=@@identity这句怎么用啊?
forestyang 2003-06-09
  • 打赏
  • 举报
回复
在rs.update 后,取得刚加入的ID可以用 select id=@@identity
bologna 2003-06-09
  • 打赏
  • 举报
回复
你用的是addnew,当然取不到值了
再做一个查询吧,select max(id) from table
许留心 2003-06-09
  • 打赏
  • 举报
回复
iid=rs("id")
custid=iid+10000前加一句

rs.movelast
iid=rs("id")
custid=iid+10000

28,391

社区成员

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

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