asp连接dll的问题
<!--METADATA TYPE='typelib' FILE='acsl.dll'--><%
Dim conn,conn2,conn3,conn4,conn5,conn6,conn7,conn8
Dim ConDB '
set ConDB = Server.CreateObject("acsl.dll")
set conn = ConDB.ConnectDB1()
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
set conn2 = ConDB.ConnectDB2()
set conn3 = ConDB.ConnectDB3()
set conn4= ConDB.ConnectDB4()
set conn5 = ConDB.ConnectDB5()
set conn6 = ConDB.ConnectDB6()
set conn7 = ConDB.ConnectDB7()
set conn8 = ConDB.ConnectDB8()
set conn9 = ConDB.ConnectDB9()
%>提示:set ConDB = Server.CreateObject("acsl.dll")
无法创建对象,acsl。dll已经注册了
acsl。dll内容如下:
Dim rp As Response
Dim rq As Request
Dim ap As Application
Dim sr As Server
Dim sn As Session
Public Sub OnStartPage(MyScriptingContext As ScriptingContext)
Set rp = MyScriptingContext.Response
Set rq = MyScriptingContext.Request
Set sr = MyScriptingContext.Server
Set ap = MyScriptingContext.Application
Set sn = MyScriptingContext.Session
End Sub
Public Sub OnEndPage()
Set rp = Nothing
Set rq = Nothing
Set sr = Nothing
Set ap = Nothing
Set sn = Nothing
'conn.Close
'Set conn = Nothing
'Set ConDB = Nothing
End Sub
Public Function ConnectDB1() As Variant
Dim conn
'Dim ConDB
Dim StrConn
StrConn = "Provider=SQLoledb;data source=YAO\sqlexpress;UID=;PWD=;Initial Catalog=userlist;Integrated Security=SSPI;data source=127.0.0.1"
Set conn = sr.reateObject("ADODB.Connection")
conn.Open StrConn
If Err Then
Err.Clear
Set conn = Nothing
MsgBox "连接失败!", 64, "提示"
Else
ConnectDB1 = conn
End If
End Function