标题:[求助]关于类模块的探讨
取消只看楼主
tiger111
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-8-19
 问题点数:0 回复次数:1 
[求助]关于类模块的探讨
我编写了一个类模块,如下
Public Function ExecuteSQL(ByVal SQL As String) As ADODB.Recordset
SQL = Trim(SQL)
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Set cnn = New ADODB.Connection
Set rst = New ADODB.Recordset

Dim strAppPath As String
strAppPath = App.Path
If Right(strAppPath, 1) <> "\" Then
strAppPath = strAppPath & "\"
End If

strAppPath = strAppPath & "data\wx.mdb"
ConnectString = "DRIVER=Microsoft Access Driver (*.mdb);DSN=" & strAppPath & ";UID=;PWD="
rst.open
Set rst.activeconnection = cnn
rst.LockType = adLockOptimistic
rst.CursorType = adOpenKeyset
rst.open SQL
Set exesql = rst
Set rst = Nothing
Set cnn = Nothing
end function
但是运行时提示“用户定义类型未定义”的错误,本人不知应是如处进行添加,请懂得的给于帮忙,谢谢!
搜索更多相关主题的帖子: 类模块 SQL strAppPath ADODB 
2007-08-19 07:38
tiger111
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-8-19
得分:0 
谢谢,已弄好
2007-08-30 13:05



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-163799-1-1.html




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

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