Dll封装数据库连接,出错,请达人指点一二

bob_wang526 2006-11-23 09:09:39
dllclass 错误 '800a005b'

未设置对象变量或 With block 变量

/Inc/Config.asp,行 11
...全文
100 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
super_user001 2006-11-23
  • 打赏
  • 举报
回复
Option Explicit
Private ScriptingContext As ScriptingContext
Private Application As Application
Private Request As Request
Private Response As Response
Private Server As Server
Private Session As Session

Private c_useTpl As String
Private c_getTpl As String
Private ci_URL As String
Private ci_IP As String
Private ci_CID As Integer
Public conn As Object
Public rs As Object

Public Sub OnStartPage(PassedScriptingContext As ScriptingContext)
Set ScriptingContext = PassedScriptingContext
Set Application = ScriptingContext.Application
Set Request = ScriptingContext.Request
Set Response = ScriptingContext.Response
Set Server = ScriptingContext.Server
Set Session = ScriptingContext.Session
Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
End Sub

Public Sub OnEndPage()
Set ScriptingContext = Nothing
Set Application = Nothing
Set Request = Nothing
Set Response = Nothing
Set Server = Nothing
Set Session = Nothing
End Sub

Private Sub Class_Initialize()
conn.Open "Provider=SQLOLEDB.1; Persist Security Info=True; Data Source=(local); Initial Catalog=dataname; User ID=username; Password=dbcpwd"
End Sub
lailuboy 2006-11-23
  • 打赏
  • 举报
回复
未设置对象变量或 With block 变量,这样的意思指对象为Nothing,你检查你的代码看数据库有没有正确打开或者打开记录集是否有误。
super_user001 2006-11-23
  • 打赏
  • 举报
回复
UP for Help

28,390

社区成员

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

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