数据库更新问题

linzhifeng 2003-09-24 11:42:27
Set qs = Server.CreateObject("ADODB.Recordset")
tm="Servfghgfjgnermappath"
sqlq="update news set tp1=" & tm
qs.Source=sqlq
qs.open sqlq,conn,2,3

为什么不能更新?
...全文
32 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
linzhifeng 2003-09-24
  • 打赏
  • 举报
回复
up
linzhifeng 2003-09-24
  • 打赏
  • 举报
回复
那这句又有什么错?
sqlq="update news set tp1='" & tm & "'" & "Where NewsID='newsid'"
hillhero789 2003-09-24
  • 打赏
  • 举报
回复
用command对象
set cmd=server.createobject("adodb.command")
cmd.activeconnection=conn 'conn是你建立的connection对象
cmd.commandText="update news set tp1='tm'"
cmd.execute
wcqwcqwcq 2003-09-24
  • 打赏
  • 举报
回复
不会吧,我发贴时回复还是0,怎么等我发完贴,就回复为6了,唉,动作还是太慢了,呵呵
wcqwcqwcq 2003-09-24
  • 打赏
  • 举报
回复
首先确实数据库是否正常连接
然后:
tm="Servfghgfjgnermappath"
Set qs = Server.CreateObject("ADODB.Recordset")
sqlq="update news set tp1='"&tm&"'" '变量tm是字符型的,不是数字型
conn.execute(sqlq) '或是你写的qs.open sqlq,conn,2,3
popcode 2003-09-24
  • 打赏
  • 举报
回复
你的字段是什么类型啊??
不是数字型要加' '
mjwgtm 2003-09-24
  • 打赏
  • 举报
回复
有错误提示吗?
homeyang 2003-09-24
  • 打赏
  • 举报
回复
这样就行啦
homeyang 2003-09-24
  • 打赏
  • 举报
回复
sqlq="update news set tp1='" & tm & "'"
linzhifeng 2003-09-24
  • 打赏
  • 举报
回复

Set qs = Server.CreateObject("ADODB.Recordset")
tm="Servfghgfjgnermappath"
sqlq="update news set tp1='tm'"
qs.Source=sqlq
qs.open sqlq,conn,2,3
就行
只是tp1字段的值是tm,怎样才能更新为Servfghgfjgnermappath

28,406

社区成员

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

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