网页制作投票系统时asp中update语句出错 10

错误类型:MicrosoftOLEDBProviderforODBCDrivers(0x80040E14)[Microsoft][ODBCMicrosoftAccessD... 错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] UPDATE 语句的语法错误。
/we/2006010409532086924/vote_count.asp, 第 31 行

<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_mydate_STRING
Recordset1.Source = "SELECT * FROM vote"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<%

set add = Server.CreateObject("ADODB.Command")
add.ActiveConnection = MM_mydate_STRING
add.CommandText = "update vote set " + Replace(add__string, "'", "''") + " = " + Replace(add__string, "'", "''") + " + 1"
add.CommandType = 1
add.CommandTimeout = 0
add.Prepared = true
add.Execute()
Response.Redirect("vote_show_vote2.asp")
%>

谢谢帮忙
展开
 我来答
zmzmzmzm4
2007-01-21
知道答主
回答量:25
采纳率:0%
帮助的人:17.1万
展开全部
add.CommandText = "update vote set " + Replace(add__string, "'", "''") + " = " + Replace(add__string, "'", "''") + " + 1"
怎么会有两个 " + Replace(add__string, "'", "''") + " 呢

第一个应该改为"+字段名+"
<%

set add = Server.CreateObject("ADODB.Command")
add.ActiveConnection = MM_mydate_STRING
add_string=Replace(add__string, "'", "''")
add_srring+=1

add.CommandText = "update vote set " + 字段名+ " = "+add_string+""
add.CommandType = 1
add.CommandTimeout = 0
add.Prepared = true
add.Execute()
Response.Redirect("vote_show_vote2.asp")
%>
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式