在项目菜单里的参考下加入microsoft activex data objects2.1 library
然后在要引用的类中加入下面:
Dim gmySession As Session, gmyApplication As Application
Dim gmyRequest As Request, gmyResponse As Response
Public Function OnStartPage(myScriptingContext As ScriptingContext)
Set gmyRequest = myScriptingContext.Request
Set gmyResponse = myScriptingContext.Response
Set gmyServer = myScriptingContext.Server
Set gmySession = myScriptingContext.Session
Set gmyApplication = myScriptingContext.Application
dsnString = gmySession("dsn")
End Function
Public Function OnEndPage()
Set gmyRequest = Nothing
Set gmyResponse = Nothing
Set gmyServer = Nothing
Set gmySession = Nothing
Set gmyApplication = Nothing
End Function
Private Function Terminate()
Call OnEndPage
End Function