今天上午刚刚注意到,当我试图从VBA的一个服务器连接桌上接通连接时,它开始使用“ODBCDVER=”而不是“ODBC;DRIVER=”。 我正在从目前的连接桌旁抽调,以作为在VBA的QeryDef的连接点。 失踪的半殖民地与QueryDef一起造成错误335: 环绕道的内障连接。
在这方面,我的职责是恢复连接。 它正在恢复以前有效的连接,而且(我记得)我没有作出任何改动。
Public Function GetObjectConnectString(ObjectName As String, ObjectType As String) As String
GetObjectConnectString = vbNullString
Dim ConnectString As String
Select Case ObjectType
Case "Table"
ConnectString = db.TableDefs(ObjectName).Connect
Case "Query"
ConnectString = db.QueryDefs(ObjectName).Connect
End Select
GetObjectConnectString = ConnectString
End Function
Is this expected behavior and I just need to handle this response by adding in the semicolon?
Using: Microsoft Access for Microsoft 365 MSO (Version 2312 Build 16.0.17126.20078) 64-bit Microsoft Visual Basic for Applications 7.1 Version 1131
Edit
这里的职能是:
Private my_db As DAO.Database
Public Function db() As DAO.Database
Set db = my_db
ErrEx.Catch 91, 3420 no longer set
Set my_db = CurrentDb
Resume
End Function