还是解决不了update问题!急死人了!

jacbey 2002-04-19 01:37:17
<%

set update = Server.CreateObject("ADODB.Command")
update.ActiveConnection = MM_connContest_STRING
update.CommandText = "UPDATE 020421Contest SET selected = 1 WHERE id = " + Replace(update__MMColParam2, "'", "''") + ""
update.CommandType = 1
update.CommandTimeout = 0
update.Prepared = true
update.Execute()////这行的错误信息:Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
%>
到底是什么原因呢?*mdb的属性已经设为什么都没有了。asp的其他功能都没有问题。
...全文
26 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
jacbey 2002-04-19
  • 打赏
  • 举报
回复
Lostinet(www.lostinet.com) 的方法没有用,我见我其他页的代码用+是没有问题的。我的问题是:
1.无论我怎么改,update.Execute()////这行都出错
2.where id 到底怎么写呢?生成代码有错吗?
Lostinet 2002-04-19
  • 打赏
  • 举报
回复
UpSelected.CommandText = "UPDATE 020421Contest SET selected =1 WHERE id =" + Replace(UpSelected__MMColParam2, "'", "''") + ""
=>
UpSelected.CommandText = "UPDATE 020421Contest SET selected =1 WHERE id =" & Replace(UpSelected__MMColParam2, "'", "''") & ""
jacbey 2002-04-19
  • 打赏
  • 举报
回复
<%

set UpSelected = Server.CreateObject("ADODB.Command")
UpSelected.ActiveConnection = MM_connContest_STRING
UpSelected.CommandText = "UPDATE 020421Contest SET selected =1 WHERE id =" + Replace(UpSelected__MMColParam2, "'", "''") + ""
UpSelected.CommandType = 1
UpSelected.CommandTimeout = 0
UpSelected.Prepared = true
UpSql = "UPDATE 020421Contest SET selected = 1 WHERE id = " + Replace(update__MMColParam2, "'", "''") + ""
UpSelected.Execute UpSql/////这行还是出错:Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)

%>
我使用dreamweaver ultradev生成代码在修改的,VBSCRIPT不太会,请高手一定帮我那忙啊!!!
Lostinet 2002-04-19
  • 打赏
  • 举报
回复
你是VBSCRIPT啊。。怎么用+号?
fdzxb 2002-04-19
  • 打赏
  • 举报
回复
UpSql = "UPDATE 020421Contest SET selected = 1 WHERE id = " + Replace(update__MMColParam2, "'", "''") + ""

conn.execute UpSql
jinyefeng 2002-04-19
  • 打赏
  • 举报
回复
也许数据库不好呢
freezwy 2002-04-19
  • 打赏
  • 举报
回复
最好不要使用关键字做为变量的名字。
你可以这样试试。
sql="update....."
MM_connContest_STRING.execute(sql)

28,391

社区成员

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

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