请教,这样封装为什么还报错?
有哪里不对吗?封装后注册。访问报错。
Public id
Public Rs
Public Sql
Public conn
Private MyScriptingContext As ScriptingContext
Private MyApplication As Application
Private MyRequest As Request
Private MyResponse As Response
Private MyServer As Server
Private MySession As Session
Public Sub OnStartPage(PassedScriptingContext As ScriptingContext)
Set MyScriptingContext = PassedScriptingContext
Set MyApplication = MyScriptingContext.Application
Set MyRequest = MyScriptingContext.Request
Set MyResponse = MyScriptingContext.Response
Set MyServer = MyScriptingContext.Server
Set MySession = MyScriptingContext.Session
End Sub
Public Sub OnEndPage()
Set Application = Nothing
Set Request = Nothing
Set Response = Nothing
Set Server = Nothing
Set Session = Nothing
Set Context = Nothing
End Sub
Public Sub fhlad()
id = MyRequest.QueryString("id")
Set Rs = Server.CreateObject("ADODB.Recordset")
Sql = "select * from guangao where oks=1 order by id desc"
Rs.open Sql, conn, 1, 1
If Not Rs.EOF Then
MyResponse.Redirect Rs("ggURL")
End If
Rs.Close
Set Rs = Nothing
conn.Close
Set conn = Nothing
End Sub