新建一个activex,创建一个module,把asp环境的6个对象的在这里用public声明
然后创建5个class modules每个里面都有
Option Explicit
Implements ObjectControlPrivate Sub ObjectControl_Activate()
On Error GoTo enderr
Set objContext = GetObjectContext()
Set comServer = objContext("Server")
Set comResponse = objContext("Response")
Set comRequest = objContext("Request")
Set comApplication = objContext("Application")
Set comSession = objContext("Session")
enderr:
If Err Then
writelog (Err.Number & Err.Description)
End If
End Sub
Private Function ObjectControl_CanBePooled() As Boolean
ObjectControl_CanBePooled = False
End Function
Private Sub ObjectControl_Deactivate()
End Sub
不知道这样作对不对??顺便问一下,除了public private,有没有什么关键字可以使所声明的函数或变量仅在此activex内可访问???比如其他语言的protect
然后创建5个class modules每个里面都有
Option Explicit
Implements ObjectControlPrivate Sub ObjectControl_Activate()
On Error GoTo enderr
Set objContext = GetObjectContext()
Set comServer = objContext("Server")
Set comResponse = objContext("Response")
Set comRequest = objContext("Request")
Set comApplication = objContext("Application")
Set comSession = objContext("Session")
enderr:
If Err Then
writelog (Err.Number & Err.Description)
End If
End Sub
Private Function ObjectControl_CanBePooled() As Boolean
ObjectControl_CanBePooled = False
End Function
Private Sub ObjectControl_Deactivate()
End Sub
不知道这样作对不对??顺便问一下,除了public private,有没有什么关键字可以使所声明的函数或变量仅在此activex内可访问???比如其他语言的protect
解决方案 »
- vb产生随机数的问题
- 如何让新添加的记录显示在listview控件的第一行,在不用的ID降序的情况下急急!
- 有谁给我一个 IJL11.DLL 的用法,谢谢100分
- 因为这里人气旺,所以在此提报表问题,高手请进!
- 调用存储过程:sp_tables_ex的问题
- 关于函数调用和循环的效率和脚本超时问题
- 各位大侠帮帮忙,急~~~~~~~~~~~~~~~~~
- 高手指教:如何暂时停止程序的执行,等待另一个事件完成?
- 请问用udp方式进行数据传输,怎样检查对方是否连接上。
- 菜鸟的疑问:基于vb的ADO控件进行数据库编程和基于VB中的createobject建立对象(如ADODB.CONNECTION,ADODB.Recordset等等)进行数据库编程,有何大的性能区别?
- 怎样判断邮箱中的信是最新的?怎样删除?
- 求教rs![fields],fields怎样用变量代替
Private myscriptingcontext As ScriptingContext
Private myapplication As Application
Private myrequest As Request
Private myresponse As Response
Private myserver As Server
Private mysession As SessionPublic 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 SubPublic Sub onendpage()
Set myscriptingcontext = Nothing
Set myapplication = Nothing
Set myrequest = Nothing
Set myresponse = Nothing
Set myserver = Nothing
Set mysession = Nothing
End Sub