在ASP中为什么变量不能共享?

lxg 2000-02-24 01:24:00
例如:c=123
conn.execute("update tb1 set price=c where no="12345")
运行后库中price的值始终没有改变,但没有出错信息,不知道是什么原因?
...全文
179 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
yhy 2000-03-01
  • 打赏
  • 举报
回复
应该改为:
dim strSQL="update tb1 set price=" & c & " where no=12345"
conn.execute strSQL
keynes 2000-02-28
  • 打赏
  • 举报
回复
c是变量的话就有错误
Daisy 2000-02-24
  • 打赏
  • 举报
回复
我也曾经碰到过类似的问题,我想是数据类型不匹配的原因。ASP中数据类型非常单一,因此你要强制将他转成所需类型。 应改为:
conn.execute("update tbl set price=" & cint(c) & " where no=12345")
zdg 2000-02-24
  • 打赏
  • 举报
回复
dengdun是对的...
dengdun 2000-02-24
  • 打赏
  • 举报
回复
应该这么写才对
conn.execute("update tb1 set price=" & c & " where no=12345")
radish 2000-02-24
  • 打赏
  • 举报
回复
change code
conn.execute("update tb1 set price=c where no="12345...
to
conn.execute("update tb1 set price="+c+ " where no="12345...)

try it.

zdg 2000-02-24
  • 打赏
  • 举报
回复
Error:
conn.execute("update tb1 set price=c where no="12345")
Correction:
conn.execute("update tb1 set price=c where no=12345")

28,390

社区成员

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

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