excel2007下 DAO运行不正常
VBA 使用Dao编写的打开数据语句,无法运行,
Set pv_MDB = DBEngine.Workspaces(0).OpenDatabase(pv_csMDB)
就报错了。
我用ado 方式打开数据库可以。
如何修改?
[最优解释]
上传个示例来
[其他解释]
Private pv_sFileName As String
Private pv_sFileName_U As String
Private pv_sSystemDate As String
Private pv_MDB As Database
Private Const pv_csMDB As String = "F:\System\TFTD_DB.mdb"
Private Const pv_csPath As String = "F:\System\File"
Private pv_sConv_Ps(8) As String
Private pv_sConvDB_Ps As String
Private pv_sConv_O(39) As String
Private pv_sConvDB_O As String
Private pv_sConv_Sp(3) As String
Private pv_sConvDB_Sp As String
Private pv_sConv_Wm(1) As String
Private pv_sConvDB_Wm As String
Private pv_sHeader_r As String ''Receipt sheet header
Private pv_sMessrs As String
Private Sub chkOriginal_Click()
End Sub
'-----------------------------------
' Function : Make Sheet
' Explanation :
' Remark :
'-----------------------------------
Private Sub cmdMake_Click()
Dim MyTable As Recordset
Dim lReturn As Long
Dim sErrCode As String
Dim sSetValue(2) As String
On Error GoTo Error
ReDim sKey(2)
''Open Database
Set pv_MDB = DBEngine.Workspaces(0).OpenDatabase(pv_csMDB)
[其他解释]
OpenDatabase就报错91
[其他解释]
你发的几个贴的问题应该都是没注册控件的缘故
工具 》 引用 ,选择后确定
[其他解释]
版主英明,目前解决了,感谢!