.DLL
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 myscriptingcontext = Nothing
Set myapplication = Nothing
Set myrequest = Nothing
Set myresponse = Nothing
Set myserver = Nothing
Set mysession = Nothing
End Sub
Public Function datasource() As Variant
datasource = "driver={sql server};server=BIT-LJN;uid=gxgl;pwd=gxgl; database=gxgl"
End Function
.ASP
<%set db_conn=Server.CreateObject("gxPjconn.gxglclass")
db_conn.datasource()%>
用VB封装ASP连接数据库的代码后,请问为什么在ASP文件里调用不了,报错呢?说
对象不支持此属性或方法: 'datasource'