| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 639 人关注过本帖
标题:asp连接dll的问题
只看楼主 加入收藏
yaopeng0418
Rank: 1
等 级:新手上路
帖 子:79
专家分:0
注 册:2008-12-28
结帖率:70.83%
收藏
 问题点数:0 回复次数:1 
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
搜索更多相关主题的帖子: 数据库连接 asp 检查 
2012-04-25 09:18
syh334
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2012-4-1
收藏
得分:0 
我也遇到这个问题
2012-05-07 21:12
快速回复:asp连接dll的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.029359 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved