0

在我们的旧系统中,我们使用的是 ms access 2003
现在我们将系统移动到 ms access 2016 现在我们
在调试时遇到自动化错误;
msSqlAccessRelations.Add "CurrentUserId", "CurrentUserId"
这一行给出错误。
我们定义了这样的哈希表
Dim msSqlAccessRelations As New Hashtable
也已经添加了 mscorlib 引用。

此代码在 ms access 2003 上完美运行

Dim db As Database
Set db = CurrentDb
Dim rs As ADODB.Recordset
Dim msQry(0) As String
Dim accessQry(0) As String
Dim msSqlAccessRelations As New Hashtable
msQry(0) = "Select * From [IFSDB].[dbo].[Notes] Where ReferNum = " & ReferNum & " AND ReferTypeId = " & ReferTypeId & " " & extraFilter & " Order by NoteID desc"
accessQry(0) = "Select CurrentUserId , CurrentUserPrinted from TblCurrentUser"
msSqlAccessRelations.Add "CurrentUserId", "CurrentUserId"
If GetMSSQLDown = False Then
    Set GetNotes = GetDataToDifferentDb(msQry, accessQry, msSqlAccessRelations, "CurrentUserPrinted,Note,NoteID,CurrentUserId,ReferNum,ReferTypeId,AppearOnReport,AppearOnBOLReport,Date,ShowForPickers")
Else
    Set GetNotes = rs
End If
4

0 回答 0