| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1714 人关注过本帖
标题:[求助]类型不匹配: 'closeconn' 恳请各位老大,高手等等救急呀!
只看楼主 加入收藏
tom88
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2006-10-16
收藏
 问题点数:0 回复次数:7 
[求助]类型不匹配: 'closeconn' 恳请各位老大,高手等等救急呀!

Microsoft VBScript 运行时错误 错误 '800a000d'

类型不匹配: 'closeconn'

/admin/vote_manage_list.asp,行 414




以下是出错的源代码,不管我是添加还是编辑,或删除,匀出现如上的错误提示

<%if session("grade")<>"10" then response.redirect "./"%>
<!--#include file="chklogin.asp"-->
<!--#include file="var.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="../sub/fun.asp"-->
<%
clearcookies
Dim ifin
ifin=False
'If Ifmanage=True or instr(sp_set,"sp_vote")>0 Then
' ifin=True
'end if

'If ifin=False Then
' call MsgOut("请求错误。","",3)
'End If

If Request("delpubl")="删除选择" Then
call deletedata()
end if
If Request("action")="addnewContent" Then
call addnewContent()
end if
If Request("action")="editContent" Then
call modifyContent()
end if
If Request("updatecount")="更新得票" Then
call updatedata()
end if
If Request("action")="Activeseting" and Request("Activeset")<>Empty and Request("id")<>Empty Then
conn.execute("update love_vote set Activeset="&Request("Activeset")&" where id="&Request("id"))

response.redirect request.servervariables("HTTP_REFERER")
end if
If Request("action")="postseting" and Request("Ipandcookies")<>Empty and Request("id")<>Empty Then
conn.execute("update love_vote set Ipandcookies="&Request("Ipandcookies")&" where id="&Request("id"))

response.redirect request.servervariables("HTTP_REFERER")
end if
%>
<html>
<head>
<title>PUBLISH SYSTEM</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../sub/main.css" rel="stylesheet" type="text/css">
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var checkflag = "false";
function check(field) {
if (checkflag == "false") {
for (i = 0; i < field.length; i++) {
field[i].checked = true;}
checkflag = "true";
return "取消全选"; }
else {
for (i = 0; i < field.length; i++) {
field[i].checked = false; }
checkflag = "false";
return "开始全选"; }
}
// End -->
</script>
</head>
<body leftmargin="3" topmargin="0" marginwidth="0" marginheight="0">
<table border="1" cellspacing="0" style="border-collapse: collapse" bordercolor="#39867B" width="100%" cellpadding="2">
<tr>
<td width="100%" bgcolor="#39867B" style="font-size: 12px; color: #FFFFFF; font-weight: bold" align="center" colspan="5">投票调查列表</td>
</tr>
<%
If Request("action")="edit" and Request("editid")<>Empty Then
set rs=server.createobject("adodb.recordset")
sql="select Votecontent,Activeset,Ipandcookies,Vote_type from love_vote where id="&Request("Editid")
rs.open(sql),conn,1,1
If Rs.Eof And Rs.Bof Then
call MsgOut("不存在此值或已被删除。","",1)
Else
Votecontent=rs("Votecontent")
Activeset=rs("Activeset")
Ipandcookies=rs("Ipandcookies")
Vote_type=rs("Vote_type")
'class_type=rs("class_type")
End If
Rs.Close:Set Rs=nothing
%>
<tr>
<td width="100%" bgcolor="#E1F4EE" style="font-size: 12px; color: #FFFFFF; font-weight: bold" align="center" colspan="3">
<table border="0" cellpadding="3" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<form method="POST" action="vote_manage_list.asp?action=editContent">
<input type="hidden" name="Id" value="<%=Request("editid")%>">
<tr>
<td width="16%" align="right">投票正文:</td>
<td width="84%">

<textarea name="Votecontent" cols="45" rows="12" ><%=Votecontent%></textarea>
</td>
</tr>
<tr>
<td width="16%" align="right">投票项目:</td>
<td width="84%" style="color: #FF0000">
<textarea rows="10" name="Votetitle" cols="72" style="border:1px solid #CCCCCC; padding:1; font-size: 12px; background-color:#F6F6F6">
<%
set rst=conn.execute("select Id,Votetitle from love_vote where (Votecontent is null) and VoteId="&Request("editid")&" order by Id")
do while not rst.eof
response.write rst("id")&"|"&Replace(Replace(Trim(rst("Votetitle")),VBCrlf,""),"?chr(34)",chr(34))&VBCrlf
rst.movenext
loop
rst.close:set rst=nothing
%></textarea> (VOTEID不能删除)</td>
</tr>
<tr>
<td width="16%" align="right">投票隶属:</td>
<td width="84%"></td>
</tr>
<tr>
<td width="16%" align="right">其他设置:</td>
<td width="84%"><input type="radio" value="1" name="Activeset" <%If Activeset=1 Then response.write("checked")%>>活动&nbsp;<input type="radio" value="0" name="Activeset" <%If Activeset=0 Then response.write("checked")%>>不活动</td>
</tr>
<tr>
<td width="16%" align="right"> </td>
<td width="84%"><input type="radio" value="0" name="Vote_type" <%If Vote_type=0 Then response.write("checked")%>>单项&nbsp;<input type="radio" value="1" name="Vote_type" <%If Vote_type=1 Then response.write("checked")%>>多项</td>
</tr>
<tr>
<td width="16%" align="right"></td>
<td width="84%">
<input type="radio" value="0" name="Ipandcookies" <%If Ipandcookies=0 Then response.write("checked")%>>用户&nbsp;<input type="radio" value="1" name="Ipandcookies" <%If Ipandcookies=1 Then response.write("checked")%>>IP&nbsp; <input type="submit" value="提交" style="font-family: 宋体; font-size: 12px">&nbsp;&nbsp; <input type="reset" value="重写" style="font-family: 宋体; font-size: 12px">&nbsp; <input onclick="history.back();" type="button" value="返回" style="font-family: 宋体; font-size: 12px"></td>
</tr>
<tr>
<td width="16%" align="right">套用地址:</td>
<td width="84%">
<input type="text" name="T1" size="70" style="font-size: 12px" value="<SCRIPT language='javascript' src='<%=url%>vote/vote.asp?Id=<%=Request("editid")%>'></SCRIPT>"></td>
</tr>
<tr>
<td width="16%"> </td>
<td width="84%"> </td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</body></html>
<%
response.end
End If
If Request("action")="addnew" Then
%>
<tr>
<td width="100%" bgcolor="#E1F4EE" style="font-size: 12px; color: #FFFFFF; font-weight: bold" align="center" colspan="3">
<table border="0" cellpadding="3" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<form method="POST" action="vote_manage_list.asp?action=addnewContent">
<tr>
<td width="16%" align="right">投票正文:</td>
<td width="84%">
<input type="hidden" name='Votecontent' value='' style="width: 1; height: 1">
<textarea rows="12" name="Votecontent" cols="72" style="border:1px solid #CCCCCC; padding:1; font-size: 12px; background-color:#F6F6F6"></textarea>
<!--IFRAME ID="eWebEditor1" SRC="Pro_edit/ewebeditor.asp?id=Votecontent&style=s_mini" FRAMEBORDER="0" SCROLLING="no" WIDTH="450" HEIGHT="250"></IFRAME-->
</td>
</tr>
<tr>
<td width="16%" align="right">投票项目:</td>
<td width="84%">
<textarea rows="10" name="Votetitle" cols="72" style="border:1px solid #CCCCCC; padding:1; font-size: 12px; background-color:#F6F6F6"></textarea></td>
</tr>
<tr>
<td width="16%" align="right">投票隶属:</td>
<td width="84%"></td>
</tr>
<tr>
<td width="16%" align="right">其他设置:</td>
<td width="84%"><input type="radio" value="1" checked name="Activeset">活动&nbsp;<input type="radio" value="0" name="Activeset">不活动</td>
</tr>
<tr>
<td width="16%" align="right"> </td>
<td width="84%"><input type="radio" value="0" checked name="Vote_type">单项&nbsp;<input type="radio" value="1" name="Vote_type">多项</td>
</tr>
<tr>
<td width="16%" align="right"></td>
<td width="84%">
<input type="radio" value="0" checked name="Ipandcookies">用户&nbsp;<input type="radio" value="1" name="Ipandcookies">IP&nbsp; <input type="submit" value="提交" style="font-family: 宋体; font-size: 12px">&nbsp;&nbsp; <input type="reset" value="重写" style="font-family: 宋体; font-size: 12px">&nbsp; <input onclick="history.back();" type="button" value="返回" style="font-family: 宋体; font-size: 12px"></td>
</tr>
<tr>
<td width="16%"> </td>
<td width="84%"> </td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</body></html>
<%
response.end
End If
%>
<tr>
<td width="100%" bgcolor="#E1F4EE" align="center" colspan="5">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<%
sql="select * from love_vote where VoteId=0 order by ID desc"
set rs=server.createobject("adodb.recordset")
rs.open(sql),conn,1,1
all_num = rs.RecordCount
ps =trim(request("Order_num"))
if Not IsNumeric(ps) or ps="" then
rs.PageSize =20
Else
rs.PageSize=cint(ps)
end If

dim maxpage,page
maxpage=rs.PageCount
page=request("page")
if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif page>maxpage then
page=maxpage
end if
%>
<tr>
<td width="100%" align="center"><%call fy("100%","ffffff","right","style='border:#E1F4EE 1px solid;'")%></td>
</tr>
<tr><form name=myform method="post" action="vote_manage_list.asp">
<td width="100%" align="center"><input onclick="window.open('vote_manage_list.asp?action=addnew','_self')" type="button" value="添加投票" style="font-family: 宋体; font-size: 12px">
<input type="submit" name="delpubl" value="删除选择" style="font-family: 宋体; font-size: 12px" onclick="return CheckDelete();">
<input onClick="this.value=check(this.form.list)" type="button" value="开始全选" style="font-family: 宋体; font-size: 12px">
<input type="submit" name="updatecount" value="更新得票" style="font-family: 宋体; font-size: 12px"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" bgcolor="#E1F4EE" align="center" colspan="5"></td>
</tr>
<tr>
<td width="1%" bgcolor="#42AA9C" style="color: #FFFFFF"></td>
<td width="5%" bgcolor="#42AA9C" align="center" style="color: #FFFFFF">操作</td>
<td width="49%" bgcolor="#42AA9C" style="color: #FFFFFF">&nbsp;投票正文</td>
<td width="34%" bgcolor="#42AA9C" align="center" style="color: #FFFFFF">投票项目</td>
<td width="11%" bgcolor="#42AA9C" align="center" style="color: #FFFFFF">创建时间</td>
</tr>
<%
if not rs.eof then
rs.AbsolutePage=Page
for i=1 to rs.PageSize
set rssum=conn.execute("select sum(Votecount) from love_vote where (Votecontent is null) and VoteId="&rs("Id"))
Votesum=rssum(0)
rssum.close:set rssum=nothing
If Rs("Activeset")=1 Then
ttt="<a href=vote_manage_list.asp?action=Activeseting&Activeset=0&id="&rs("Id")&">取消活动</a>"
ElseIf Rs("Activeset")=0 Then
ttt="<a href=vote_manage_list.asp?action=Activeseting&Activeset=1&id="&rs("Id")&">设置活动</a>"
End If
If Rs("Ipandcookies")=1 Then
tttt="<a href=vote_manage_list.asp?action=postseting&Ipandcookies=0&id="&rs("Id")&">用户限制</a>"
Elseif Rs("Ipandcookies")=0 Then
tttt="<a href=vote_manage_list.asp?action=postseting&Ipandcookies=1&id="&rs("Id")&">IP限制</a>"
End If
%>
<tr>
<td width="1%" bgcolor="#E1F4EE">
<input type=checkbox name=list value="<%=rs("Id")%>" style="font-size: 12px"></td>
<td width="5%" bgcolor="#E1F4EE" align="center"><a href=vote_manage_list.asp?list=<%=rs("Id")%>&delpubl=删除选择 onclick="return CheckDelete();">删除</a><br>
<a href=vote_manage_list.asp?action=edit&editid=<%=rs("Id")%>>编辑</a></td>
<td width="49%" bgcolor="#E1F4EE">
<table border="0" cellpadding="5" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="100%" bgcolor="#ECF9F4" style="line-height: 140%"><%=replace(rs("Votecontent"),"?chr(34)","'")%><font color="#FF0000">(得票数:<%=Votesum%>)</font></td>
</tr>
</table>
</td>
<td width="34%" bgcolor="#E1F4EE" align="center">
<table border="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" cellspacing="0">
<%
set rst=conn.execute("select id,Votetitle,Votecount from love_vote where (Votecontent is null) and VoteId="&rs("Id")&" order by Id")
a=1
do while not rst.eof
%>
<tr>
<td width="100%" bgcolor="#ECF9F4"><input type="radio" value="<%=rst("id")%>" name="V_id" checked><input type="text" name="Votecount<%=rst("id")%>" size="5" style="font-size: 12px" value="<%=rst("Votecount")%>">&nbsp;<%=a%>.<%=rst("Votetitle")%></td>
</tr>
<%
a=a+1
rst.movenext
loop
rst.close:set rst=nothing
%>
</table>
</td>
<td width="11%" bgcolor="#E1F4EE" align="center" style="line-height: 140%"><%=ttt%><br><%=tttt%><br><%=rs("Adddatetime")%></td></tr><%rs.movenext:if rs.EOF then Exit For
next
end if
rs.close:set rs=nothing

%></form></table>
<script language=javascript>
function CheckDelete()
{
return confirm("确实删除所选文档吗?");
}
</script>
</body></html><%Sub deletedata()
lists=Split(Request("list"),",")
FOR i=0 TO Ubound(lists)
if trim(lists(i))=empty then
call MsgOut("所选文档出现空值。","",1)
exit For
else
conn.execute("delete from love_vote where Id="&lists(i))
conn.execute("delete from love_vote where VoteId="&lists(i))
conn.execute("delete from love_vote_bbs where Vote_Id="&lists(i))
end if
Next
closeconn
response.redirect request.servervariables("HTTP_REFERER")
End Sub
Sub addnewContent()
Votecontent=Replace(Replace(request.form("Votecontent"),"'",""),chr(34),"?chr(34)")
Vtitle=Replace(Replace(request.form("Votetitle"),"'",""),chr(34),"?chr(34)")
Activeset=Replace(request.form("Activeset"),"'","")
Ipandcookies=Replace(request.form("Ipandcookies"),"'","")
Vote_type=Replace(request.form("Vote_type"),"'","")
'class_type=Replace(request.form("class_type"),"'","")
If trim(Votecontent)=Empty Then
call MsgOut("投票正文出现空值。","",1)
End If
If trim(Vtitle)=Empty Then
call MsgOut("投票项目出现空值。","",1)
End If
Votetitle=split(Vtitle,VBCrlf)
If trim(Votetitle(0))=Empty Then
call MsgOut("投票项目出现空值。","",1)
End If
'set rs=server.createobject("adodb.recordset")
'rs.open"select id,Votecontent,Activeset,Ipandcookies,Vote_type from love_vote where (id is null)",conn,1,3
conn.execute "insert into love_vote(Votecontent,Activeset,Ipandcookies,Vote_type,Adddatetime) values ('"&Votecontent&"','"&Activeset&"','"&Ipandcookies&"','"&Vote_type&"',now())"
'rs.addnew
'rs("Votecontent")=Votecontent
'rs("Activeset")=Activeset
'rs("Ipandcookies")=Ipandcookies
'rs("Vote_type")=Vote_type
'rs.update
set rs=server.createobject("adodb.recordset")
Rs.Open "select top 1 id from love_vote order by id desc",conn,1,1
nndId=rs("id")
rs.close:set rs=nothing
FOR i=0 TO Ubound(Votetitle)
IF not isnull(Votetitle(i)) and trim(Votetitle(i))<>Empty THEN
conn.execute "Insert Into love_vote(VoteId,Votetitle) Values('"&nndId&"','"&Votetitle(i)&"')"
END IF
NEXT
' call Chklog(session("Login_admin"),"增加新投票",0)
closeconn
call MsgOut("成功增加新投票。","vote_manage_list.asp",2)
End Sub
Sub updatedata()
V_Id=Replace(request.form("V_id"),"'","")
V_count=Replace(request.form("Votecount"&""&V_Id&""),"'","")
If trim(V_Id)=Empty Then
call MsgOut("ID出现空值。","",1)
End If
If Not IsNumeric(V_count) or trim(V_count)=Empty Then
call MsgOut("投票数出现空值。","",1)
End If
conn.execute("update love_vote set Votecount="&V_count&" where id="&V_Id)
closeconn
call MsgOut("成功更新投票数量。","",1)
End Sub
Sub modifyContent()
V_Id=Replace(request.form("Id"),"'","")
Votecontent=Replace(Replace(request.form("Votecontent"),"'",""),chr(34),"?chr(34)")
Vtitle=Replace(Replace(request.form("Votetitle"),"'",""),chr(34),"?chr(34)")
Activeset=Replace(request.form("Activeset"),"'","")
Ipandcookies=Replace(request.form("Ipandcookies"),"'","")
Vote_type=Replace(request.form("Vote_type"),"'","")
'class_type=Replace(request.form("class_type"),"'","")
If Not IsNumeric(V_Id) or trim(V_Id)=Empty Then
call MsgOut("主ID出现空值。","",1)
End If
If trim(Votecontent)=Empty Then
call MsgOut("投票正文出现空值。","",1)
End If
If trim(Vtitle)=Empty Then
call MsgOut("投票项目出现空值。","",1)
End If
temptitle=split(Vtitle,VBCrlf)
If trim(temptitle(0))=Empty Then
call MsgOut("投票项目出现空值。","",1)
End If
set rs=server.createobject("adodb.recordset")
rs.open"select Votecontent,Activeset,Ipandcookies,Vote_type from love_vote where id="&V_Id,conn,1,3
rs("Votecontent")=Votecontent
rs("Activeset")=Activeset
rs("Ipandcookies")=Ipandcookies
rs("Vote_type")=Vote_type
'rs("class_type")=class_type
rs.update
rs.close:set rs=nothing
Dim TId(200),Tteile(200)
FOR i=0 TO Ubound(temptitle)
If not isnull(temptitle(i)) and Trim(temptitle(i))<>Empty Then
TId(i)=split(temptitle(i),"|")(0)
If not isnull(TId(i)) and trim(TId(i))<>Empty Then
Tteile(i)=split(temptitle(i),"|")(1)
IF trim(TId(i))<>Empty And trim(Tteile(i))<>Empty THEN conn.execute ("update love_vote set Votetitle='"&Tteile(i)&"' where id="&TId(i))
End If
End If
NEXT
' call Chklog(session("Login_admin"),"修改投票",0)
closeconn
call MsgOut("成功修改投票数据。","",1)
End Sub
%>



恳请各位老大,高手等等救急呀!!!!


Microsoft VBScript 运行时错误 错误 '800a000d'

类型不匹配: 'closeconn'

/admin/vote_manage_list.asp,行 414

搜索更多相关主题的帖子: closeconn 老大 类型 
2007-01-29 00:11
tom88
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2006-10-16
收藏
得分:0 
奇怪的是后台报错,而前台却能正常工作,如该删除的还是删了,该编辑的还是编辑

了。。。。。。所以我无从下手
2007-01-29 00:15
高寒
Rank: 2
等 级:论坛游民
帖 子:134
专家分:20
注 册:2005-10-25
收藏
得分:0 
你检查一下你的conn.asp文件看看是用过程写的还是用函数写的

2007-01-29 09:40
hangxj
Rank: 6Rank: 6
等 级:贵宾
威 望:29
帖 子:2045
专家分:0
注 册:2006-4-10
收藏
得分:0 
closeconn
应该是定义的关闭数据连接的函数,自己检查一下

http://www./
2007-01-29 16:00
tom88
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2006-10-16
收藏
得分:0 
以下是引用高寒在2007-1-29 9:40:00的发言:
你检查一下你的conn.asp文件看看是用过程写的还是用函数写的

2007-01-29 22:57
tom88
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2006-10-16
收藏
得分:0 
<%
dim ax
ax=5
if ax=1 then
set Conn=server.createobject("ADODB.connection")
Conn.ConnectionString ="Provider=SQLOLEDB.1;Password=123456;Persist Security Info=True;User ID=love;Initial Catalog=love;Data Source=(local);Connect Timeout=15"
Conn.Open
else
set conn=server.createobject("adodb.connection")
conn.open"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../data/haphz123.asp")
end if
%>
2007-01-29 22:58
tom88
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2006-10-16
收藏
得分:0 
类型不匹配: 'closeconn' 恳请各位老大,高手等等救急呀!
2007-01-31 21:43
google
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:22
帖 子:3419
专家分:23
注 册:2005-11-1
收藏
得分:0 
closeconn函数贴出来,是不是没有引入这个函数啊?

祝天下所有母亲幸福安康!~
2007-02-01 09:46
快速回复:[求助]类型不匹配: 'closeconn' 恳请各位老大,高手等等救急呀!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.041246 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved