| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 855 人关注过本帖
标题:vb引用dll出现问题
只看楼主 加入收藏
yaopeng0418
Rank: 1
等 级:新手上路
帖 子:79
专家分:0
注 册:2008-12-28
结帖率:70.83%
收藏
已结贴  问题点数:20 回复次数:3 
vb引用dll出现问题
vb代码如下:
sr为定义的server
Set ConDB = sr.CreateObject("krmc.dll")
Set conn = ConDB.ConnectDB(code, mima)
dll代码如下:
Public Function ConnectDB(ByVal zhanghao As Variant, ByVal mima As Variant) As Variant


Dim Conn
Dim ConDB
Dim StrConn
StrConn = "Provider=SQLoledb;data source=YAO;UID=;PWD=;Initial Catalog=rainbow;Integrated Security=SSPI;data source=127.0.0.1"

Set Conn = Server.CreateObject("ADODB.CONNECTION")

Conn.Open StrConn
If Err Then
Err.Clear
Set Conn = Nothing
MsgBox "连接失败!", 64, "提示"

rp.End
End If
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT * FROM Userinfo WHERE code='" & zhanghao & "' and password='" & mima & "'", Conn, 1, 3
If rs.EOF Then
ConnectDB = rs("username")


Else
MsgBox "帐号或密码错误!", 64, "提示"
End If

End Function
请教高手
搜索更多相关主题的帖子: rainbow source 
2011-11-05 10:57
Laserw9
Rank: 1
等 级:新手上路
帖 子:2
专家分:7
注 册:2011-3-29
收藏
得分:7 
Server是什么类型的对象?
2011-11-05 14:35
Artless
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
等 级:贵宾
威 望:103
帖 子:4211
专家分:28888
注 册:2009-4-8
收藏
得分:7 
以下是引用yaopeng0418在2011-11-5 10:57:55的发言:

vb代码如下:
sr为定义的server
Set ConDB = sr.CreateObject("krmc.dll")
Set conn = ConDB.ConnectDB(code, mima)
dll代码如下:
Public Function ConnectDB(ByVal zhanghao As Variant, ByVal mima As Variant) As Variant


Dim Conn
Dim ConDB
Dim StrConn
StrConn = "Provider=SQLoledb;data source=YAO;UID=;PWD=;Initial Catalog=rainbow;Integrated Security=SSPI;data source=127.0.0.1"

Set Conn = Server.CreateObject("ADODB.CONNECTION")

Conn.Open StrConn
If Err Then
Err.Clear
Set Conn = Nothing
MsgBox "连接失败!", 64, "提示"

rp.End
End If
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT * FROM Userinfo WHERE code='" & zhanghao & "' and password='" & mima & "'", Conn, 1, 3
If rs.EOF Then
ConnectDB = rs("username")


Else
MsgBox "帐号或密码错误!", 64, "提示"
End If

End Function
请教高手

问题?
另?
Set conn = ConDB.ConnectDB(code, mima)
Public Function ConnectDB(ByVal zhanghao As Variant, ByVal mima As Variant) As Variant
Dim Conn

无知
2011-11-06 00:01
yaopeng0418
Rank: 1
等 级:新手上路
帖 子:79
专家分:0
注 册:2008-12-28
收藏
得分:0 
回复 3楼 Artless
运行时错误'429'
ActiveX 部件不能创建对象
2011-11-06 07:13
快速回复:vb引用dll出现问题
数据加载中...
 
   



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

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