[求助]未找到驱动器
我程序运行时正常,打包后运行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
不知道哪里写错了,请教大家,谢谢!