大家帮我看看这个代码出错在哪里啊?
大家帮我看看这个代码啊,公司的网站才拿到就出错了,我一点都不懂偏偏要喊我来该,大家帮帮忙啊!
——————————————————————————————————————————————————————
<%
Dim startTime
startTime=Timer()
set conn=server.CreateObject("adodb.connection")
DBPath = Server.MapPath(lc_Dataname)
conn.open "provider=microsoft.jet.oledb.4.0; data source="&DBpath
set connshop=server.CreateObject("adodb.connection")
DBPath2 = Server.MapPath(lc_Dataname2)
If Err Then
Err.Clear
Set connshop = Nothing
Response.Write "数据连接错误!"
Response.End
End If
StartTime = Timer()
PageURL=Lcase(Request.ServerVariables("URL"))
SqlNum=0
CacheName="firend"&Replace(left(PageURL,instrRev(PageURL,"/")),"/","")
'执行SQL返回集合对象
public function RsOpen(R_Sql,R_n,R_i)
Set Rsc=Server.CreateObject("ADODB.recordset")
if Not IsObject(connshop) Then response.End()
Rsc.open R_sql,connshop,R_n,R_i
set RsOpen =Rsc
SqlNum=SqlNum+1
end function
'执行SQL返回集合对象
public function RsOpen2(R_Sql,R_n,R_i)
Set Rsc=Server.CreateObject("ADODB.recordset")
if Not IsObject(conn) Then response.End()
Rsc.open R_sql,connshop,R_n,R_i
set RsOpen =Rsc
SqlNum=SqlNum+1
end function
'执行SQL
Public Function Execute(T_Sql)
If Not IsObject(connshop) Then response.End()
Set Execute = connshop.Execute(T_Sql,,adcmdtext)
SqlNum=SqlNum+1
End Function
Public Function Execute2(T_Sql)
If Not IsObject(conn) Then response.End()
Set Execute2 = conn.Execute(T_Sql,,adcmdtext)
SqlNum=SqlNum+1
End Function
'关闭数据库,释放内存,返回执行时间
if isobject(Rsc) then
set Rsc=nothing
end if
if isobject(connshop) then
Set Connshop=nothing
end if
endtime= timer()
ConnClose=FormatNumber((endTime-starTime)/1000000,6,-1)'秒
end function
'On Error Resume Next
%>
<!--#include file="inc/CountOnline.asp"-->
function ConnClose()
——————————————————————————————————————————————————
上面是代码,下面是错误提示:
ADODB.Recordset 错误 '800a0e7d'
连接无法用于执行此操作。在此上下文中它可能已被关闭或无效。
/conn.asp,行 34