初学asp,请教各位大虾一个问题急!急!急!急!急!急!

toxic888 2005-04-28 04:53:11
一个在线调查的表单,不选择直接点提交按钮,出现错误
Microsoft VBScript 运行时错误 错误 '800a000d'

类型不匹配: 'v'

/cs/function/show.asp,行63

其他功能正常,改怎么办???????



代码如下:

<%
Function showhot()
Sql = "SELECT * FROM protable ORDER BY show DESC,dateandtime DESC"
Set Rs = Conn.Execute(Sql)
If Rs.Eof AND Rs.Bof Then
Response.Write "Nothing!"
Else
Response.Write "<table width='316' border='0' align='right' cellpadding='0' cellspacing='0'>"
Response.Write "<tr><td width='176'><!--<img src='../product/"&Rs("photo")&"' width='176' height='186'>-->"
Response.Write "</td><td width='120' class='font2'><p> </p><p> </p><p><strong>"&Rs("title")&"</strong></p>"
Response.Write "<p>"&Rs("remark")&"</p></td><td width='20'> </td></tr></table>"
End If
End Function

Function showAlert()
tSql = "SELECT title,content FROM infotable WHERE ftype='网站公告' AND flag>0 ORDER BY show DESC,dateandtime DESC"
Set tRs = Conn.Execute(tSql)
If tRs.Eof AND tRs.Bof Then
showAlert = false
Else
showAlert = true
End If
End Function

Function checkVote()
vSql = "SELECT id FROM vote WHERE flag<0 ORDER BY dateandtime DESC"
Set vRs = Conn.Execute(vSql)
If vRs.Eof AND vRs.Bof Then
checkVote = false
Else
checkVote = true
End If
End Function

Function getPoll()
If getQuery("action") = "view" Then
If checkExprise(getQuery("id")) Then
getPoll = false
Else
getPoll = true
End If
Else
'If (Request.Cookies("poll")("ip") = getIp()) AND (Request.Cookies("poll")("id") = getQuery("id")) Then
getPoll = false
'Else
items = getQuery("items")
id = getQuery("id")
If IsEmpty(items) OR IsNull(items) Then alert "请选择相应选项后再进行投票!","back",null
If checkExprise(id) Then
getPoll = false
Else
Sql = "SELECT thevalue FROM vote WHERE id="&id&""
Set Rs = Conn.Execute(Sql)
If Rs.Eof AND Rs.Bof Then
getPoll = false
Else
thevalues = split(Rs(0),"|")
If Len(items) > 2 Then items = split(items,",")
If Not IsArray(items) Then
items = array(items)
End If
For Each v in items
thevalues(v) = (cint(thevalues(v)) + 1)
Next
tempvalue = ""
For j = 0 To ubound(thevalues) - 1
tempvalue = tempvalue & thevalues(j) & "|"
Next
tSql = "UPDATE vote SET thevalue='"&tempvalue&"' WHERE id="&id&""
Conn.Execute(tSql)
If Err.Number > 0 Then
getPoll = false
Else
Response.Cookies("poll")("ip") = getIp()
Response.Cookies("poll")("id") = id
getPoll = true
End If
End If
End If
'End If
End If
End Function

Function checkExprise(id)
sql = "SELECT enddate FROM vote WHERE id="&id&""
Set rs = Conn.Execute(Sql)
If Rs.Eof AND Rs.Bof Then
checkExprise = true
Else
If cdate(date()) > cdate(Rs(0)) Then
checkExprise = true
Else
checkExprise = false
End If
End If
End Function

Function getTotal(numArray)
total = 0
For i = 0 To ubound(numArray)-1
total = total + Cint(numArray(i))
Next
getTotal = total
End Function

Function countPercent(n,total)
If total = 0 Then
countPercent = 0
Else
countPercent = round((n / total) * 100,4)
End If
End Function


Function showVote()
Sql = "SELECT * FROM vote WHERE flag<0 ORDER BY dateandtime DESC"
Set Rs = Conn.Execute(Sql)
If Rs.Eof AND Rs.Bof Then
vList = "<center>暂时没有记录!</center>"
Else
vList = "<table border='0' width='90%' align='center' id='table1' cellspacing='1' style='border-collapse: collapse' bordercolor='#000000'>"
vList = vList & "<form method='GET' name='voteForm' action='poll.asp'><tr><td width='100%'>"&Rs("title")&"</td></tr>"
If Not IsEmpty(Rs("content")) Then
vList = vList & "<tr><td width='100%'>"&Rs("content")&"</td></tr>"
End If
itemList = split(Rs("theitem"),"|")
For i=0 To ubound(itemList) - 1
vList = vList & "<tr><td width='100%'>"
If Rs("kinds") = "more" Then
vList = vList & "<input type='checkbox' name='items' value='"&i&"'>"
Else
vList = vList & "<input type='radio' name='items' value='"&i&"'>"
End If
vList = vList & itemList(i) &"</td></tr>"
Next
vList = vList & "<tr><td width='100%'><p align='center'><input type='submit' value='提交'> "
vList = vList & "<input type='button' onclick=javascript:window.open('poll.asp?action=view&id="&Rs("id")&"') value='查看'></p>"
vList = vList & "</td></tr><input type='hidden' name='id' value='"&Rs("id")&"'></form></table>"
End If
Response.Write vList
End Function

%>
...全文
180 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
qiqunet 2005-04-28
  • 打赏
  • 举报
回复

先response.write(v)看一看,看看所有的 v 是不是都是阿拉佰数字,如果都是的话可这样处理出错的那一句:


thevalues( 0 + v) = 0 + thevalues( 0 + v ) + 1





yodooer 2005-04-28
  • 打赏
  • 举报
回复
v加‘’
toxic888 2005-04-28
  • 打赏
  • 举报
回复
行63 应该是thevalues(v) = (cint(thevalues(v)) + 1)

谢谢!!!
toxic888 2005-04-28
  • 打赏
  • 举报
回复
行63 应该是thevalues(v) = (cint(thevalues(v)) + 1)

谢谢!!!
leo963258 2005-04-28
  • 打赏
  • 举报
回复
那一行啊...

28,405

社区成员

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

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