小问题???

what_004 2006-01-24 02:17:24
数据表STU有两个字段user和id
当调用SQL=select * from STU where id=1,返回记录后
如何把user的值写进id=1对应的记录的user字段中(用user替换原来的user,id不变)
sql语句该如何写???
...全文
62 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
tokilcoom 2006-01-24
  • 打赏
  • 举报
回复
user1=request.form("user1")
set conn=.....
conn.open "...."
sql="update stu set user(字段)='"+user1+"'where id=1"
conn.execute sql
conn.close
set conn=nothing
若白师妹 2006-01-24
  • 打赏
  • 举报
回复
1.SQL=select * from STU where id=1
rs.open sql,conn,1,3
rs("user")=新user
rs.update
rs.close

2.sql="update stu set [user]='"& user &"' where id=1"
conn.execute sql
tokilcoom 2006-01-24
  • 打赏
  • 举报
回复
update就可以了
sql="update 表 set user='"&user&"' where id=1

28,406

社区成员

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

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