ACC97: "Invalid procedure call" Error with Linked Table ManagerID: Q172347
|
Moderate: Requires basic macro, coding, and interoperability skills.
When you run the Linked Table Manager, you receive the following error
message:
Even if you delete the linked table(s), you continue to receive this error message until you quit and then restart Microsoft Access.Invalid procedure call or argument.
You have at least one table linked to a File DSN. The Linked Table Manager generates an error if it doesn't find the strings "DSN=" and "DATABASE=" in the Connect property of a linked table. If a table is linked to a File DSN, its Connect property doesn't contain the parameter string "DSN=". Furthermore, for some data sources such as ORACLE, the specifier "DATABASE=" may also be missing from the Connect property.
Function ChangeLink(strLinkName As String, strDSNName As String, _
Optional IsFileDSN As Boolean)
Dim db As Database
Dim strConn As String
On Error GoTo Errorhandler
Set db = CurrentDb
strConn = db.TableDefs(strLinkName).Connect
' Remove Driver and Server information
' from the connect string.
strConn = Right(strConn, Len(strConn) - _
InStr(1, strConn, "APP=") + 1)
' Concatenate new File DSN to
' the connect string.
If IsFileDSN Then
strConn = "ODBC;FILEDSN=" & strDSNName & ";" & strConn
Else
strConn = "ODBC;DSN=" & strDSNName & ";" & strConn
End If
' Link with the new connect string.
With db.TableDefs(strLinkName)
.Connect = strConn
.RefreshLink
End With
Exit Function
Errorhandler:
MsgBox Err & " " & Err.Description
Exit Function
End Function
Microsoft has confirmed this to be a problem in Microsoft Access 97.
Microsoft Access displays the connection information for a linked table in the Description property. If a table is linked to a File DSN, and you open that table in Design view, you see that the connection string in the Description property box does not refer directly to the DSN. Instead, it contains the server and driver information specified in the File DSN. Even if you change the Connect property in code so that it refers directly to the File DSN, when you view the table's properties after you have refreshed the link, you see that the connection string still does not contain "DSN=" or refer directly to the File DSN.
Invalid procedure call or argument.
For more information about the Connect property, search the Help Index for
"Connect property."
For more information about File DSNs, please see the following article in
the Microsoft Knowledge Base:
Q165866 How to Use File DSNs and DSN-less Connections
Additional query words: attached reset
Keywords : kberrmsg WzAtmgr
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: May 13, 1999