我用DREAMWEAVER 写一个更新程序遇到问题

bobozc 2006-07-28 11:03:38
sj和bs是上页传过来的数据
sj 是int型的
bs 是varchar型的

用bs 做条件时就出错 说列名无效
用sj 做条件就没问题


<%

if(request("sj") <> "") then setjf__w = request("sj")

if(request("bs") <> "") then setjf__o = request("bs")

%>
<%

set setjf = Server.CreateObject("ADODB.Command")
setjf.ActiveConnection = MM_soccersql_STRING
setjf.CommandText = "UPDATE dbo.jf SET zw ='1' WHERE bssj in (" + Replace(setjf__w, "'", "''") + ") and jfsx='1' and bs in (" + Replace(setjf__o, "'", "''") + ")"
setjf.CommandType = 1
setjf.CommandTimeout = 0
setjf.Prepared = true
setjf.Execute()

%>
...全文
127 1 打赏 收藏 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
孟子E章 2006-07-28
  • 打赏
  • 举报
回复
and bs in ('" + Replace(setjf__o, "'", "''") + "')"

28,402

社区成员

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

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