xinicp 发表于 2008-10-7 21:56:33

求高手调试代码

Microsoft VBScript 运行时错误 (0x800A01A8)
缺少对象: \'objConn\'
C:\\INETPUB\\WWWROOT\\SSSS\\ADMIN\\../function/c_System_Base.asp, 第 69 行

后台登不上去,不知道哪出错了
大哥们帮帮


<%

\'定义全局变量
Dim ConnStr
Dim objConn
Dim objRS
Dim strSQL
Dim StarTime
Dim EndTime
StarTime = Timer()

\'*********************************************************
\' 目的:    System 初始化
\'*********************************************************
Sub System_Initialize()
If OpenConnect=False Then
Call OpenConnect()
If Err Then
   err.Clear
   Call System_Terminate()
   Call ShowError(\"Database Conecting Error.\",\"/\")
End If
End If
End Sub
\'*********************************************************

\'*********************************************************
\' 目的:    System 释放
\'*********************************************************
Sub System_Terminate()
Call CloseConnect()
End Sub
\'*********************************************************

\'*********************************************************
\' 目的:    数据库连接
\'*********************************************************
Function OpenConnect()
ConnStr = \"Provider = Sqloledb; User ID = \" & SqlUsername & \"; Password = \" & SqlPassword & \"; Initial Catalog = \" & SqlDatabaseName & \"; Data Source = \" & SqlLocalName & \";\"
Set objConn = Server.CreateObject(\"ADODB.Connection\")
objConn.Open ConnStr
OpenConnect=True
End Function
\'*********************************************************

\'*********************************************************
\' 目的:    DB Disable Connect
\'*********************************************************
Function CloseConnect()
objConn.Close
Set objConn = Nothing
End Function
\'*********************************************************

\'*********************************************************
\' 目的:    时间计长
\'*********************************************************
Function RunTime()
EndTime=Timer()
RunTime = CLng(FormatNumber((EndTime-StarTime)*1000,3))
End Function
\'*********************************************************

\'*********************************************************
\' 目的:    错误打印
\'*********************************************************
Sub ShowError(str,url)
Response.Write \"<div style=\"\"font-size:14px; font-family:tahoma; border:1px #84ACE7 solid; background:#ECF1FB; padding:9px 7px 7px 9px;\"\"><b>Info:</b><BR /> \"& str &\" <BR /><BR /><a href=\"\"javascript:window.location=\'\"& url &\"\'\"\">[返回]</a></div>\"
Response.End
End Sub
Sub BackError(str)
Response.Write \"<div style=\"\"font-size:14px; font-family:tahoma; border:1px #84ACE7 solid; background:#ECF1FB; padding:9px 7px 7px 9px;\"\"><b>Info:</b><BR /> \"& str &\" <BR /><BR /><a href=\"\"javascript:history.go(-1);\"\">[返回]</a></div>\"
Response.End
End Sub
\'*********************************************************

\'*********************************************************
\' 目的:    检查登陆
\'*********************************************************
Function CheckLogin()
If CheckPostUrl = False Then
   Call ShowError(\"禁止站外恶意提交数据!\",\"index.asp\")
End If
Dim AdminName,AdminClass,Sql,Rs

AdminName = session(\"AdminName\")
AdminClass = session(\"AdminClass\")
If Len(AdminName) < 1 then
Call ShowError(\"尚未登陆或者登陆超时,请返回登陆页面!\",\"index.asp\")
End If

Sql=\"select top 1 AdminID from c_Admin Where AdminName=\'\"& AdminName &\"\' and AdminClass=\'\"& AdminClass &\"\'\"
Set Rs=objConn.Execute(Sql)
If Rs.eof And Rs.bof Then
Call System_Terminate()
session(\"AdminName\") = \"\"
session(\"AdminClass\") = \"\"
Call ShowError(\"登陆信息有误!\",\"index.asp\")
End If
End Function
\'*********************************************************

\'*********************************************************
\' 目的:    用户退出
\'*********************************************************
Public Function AdminLogout()
session(\"AdminName\") = \"\"
session(\"AdminClass\") = \"\"
Response.Redirect \"../\"
End Function
\'*********************************************************
%>

黑马王子 发表于 2008-10-8 19:01:52

写这么多看起眼花哟!

黑马王子 发表于 2008-10-8 19:03:06

后台数据苦链接文件是不是没写对?

outou 发表于 2008-10-9 21:23:43

走过路过,抢过虎币

dingwenhua 发表于 2013-7-10 20:16:46

走过路过,抢过虎币 嘿嘿
页: [1]
查看完整版本: 求高手调试代码