标题:[求助]未找到驱动器
只看楼主
tiger111
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-8-19
 问题点数:0 回复次数:0 
[求助]未找到驱动器

我程序运行时正常,打包后运行exe时提示错误:



我的代码
Public Function exesql(ByVal sql As String) As ADODB.Recordset
sql = Trim(sql)
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim strAppPath As String
strAppPath = App.Path
If Right(strAppPath, 1) <> "\" Then
strAppPath = strAppPath & "\"
End If

strAppPath = strAppPath & "Data\wx.mdb"
Set cnn = New ADODB.Connection
Set rst = New ADODB.Recordset
cnn.ConnectionString = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & strAppPath & ";PWD=;"
cnn.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

不知道哪里写错了,请教大家,谢谢!

搜索更多相关主题的帖子: 驱动器 
2007-10-25 16:19



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




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

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