头部多汗症怎么治疗:ASP代码错误,求解!

来源:百度文库 编辑:神马品牌网 时间:2024/05/09 06:04:55
代码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../incs/disdbconn.asp"-->
<!--#include file="../incs/adtimeout.asp"-->
<%Function IsObjInstalled(strClassString)
On Error Resume Next
IsObjInstalled = False
Err = 0
Dim xTestObj
Set xTestObj = Server.CreateObject(strClassString)
If 0 = Err Then IsObjInstalled = True
Set xTestObj = Nothing
Err = 0
End Function %>
<%
dim ID,Action,sqlDel,rsDel,FoundErr,ErrMsg,ObjInstalled
ID=trim(request("ID"))
Action=Trim(Request("Action"))
FoundErr=False
ObjInstalled=IsObjInstalled("Scripting.FileSystemObject")

if ID="" or Action<>"Del" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>参数不足!</li>"
end if
if FoundErr=False then
if instr(ID,",")>0 then
dim idarr,i
idArr=split(ID)
for i = 0 to ubound(idArr)
call DelNews(clng(idarr(i)))
next
else
call DelNews(clng(ID))
end if
end if
if FoundErr=False then
call CloseConn()
response.Redirect "News_Manage.asp"
else
call CloseConn()
call WriteErrMsg()
end if

sub DelNews(ID)
PurviewChecked=False
sqlDel="select * from News where ID=" & CLng(ID)
Set rsDel= Server.CreateObject("ADODB.Recordset")
rsDel.open sqlDel,conn,1,3
if FoundErr=False then
if DelUpFiles="Yes" and ObjInstalled=True then
dim fso,strUploadFiles,arrUploadFiles
strUploadFiles=rsDel("firstImageName") & ""
if strUploadFiles<>"" then
Set fso = CreateObject("Scripting.FileSystemObject")
if instr(strUploadFiles,"|")>1 then
arrUploadFiles=split(strUploadFiles,"|")
for i=0 to ubound(arrUploadFiles)
if fso.FileExists(server.MapPath("../" & arrUploadfiles(i))) then
fso.DeleteFile(server.MapPath("../" & arrUploadfiles(i)))
end if
next
else
if fso.FileExists(server.MapPath("../" & strUploadfiles)) then
fso.DeleteFile(server.MapPath("../" & strUploadfiles))
end if
end if
Set fso = nothing
end if
end if
rsDel.delete
rsDel.update
set rsDel=nothing
end if
end sub
%>
错误:类型不匹配: 'CloseConn'
作用:ASP+SQL用于删除新闻内容.
可以帮忙改一下这个代码吗

有CloseConn()过程名了吗
如果有
不要用
call CloseConn()

CloseConn()
试试吧

好多了,我不想成近视哈

检查你的所有导入文件是否包含CloseConn()过程的定义。

注意CloseConn()应该是一个过程Sub,不是函数Function,函数不能用Call来调用的。