troubleshooting Question

Pass through qry error message

Avatar of route217
route217Flag for United Kingdom of Great Britain and Northern Ireland asked on
Microsoft Access
20 Comments1 Solution1254 ViewsLast Modified:
Hi Epxerts

I am running the following vba to check my DSN connections....and getting the following error message

3305 (invaild connection string in pass-through qry) in procedure  GetQueryLinks of module bas TableLink


Is ther ea way to change the vba code to replace all old dsn connection with a new one a spoecify if not....how can i trace which one to replace.....


Code:

Public Function GetQueryLinks()
On Error GoTo Err_GetQueryLinks

    Dim qdf As DAO.QueryDef
    Dim strConn As String
    
    'strConn = "'ODBC;Driver={Microsoft ODBC for Oracle};UID=MyUID;PWD=MyPass;SERVER=TheServer;"
        For Each qdf In CurrentDb.QueryDefs
        If qdf.Connect <> "" Then
            qdf.Connect = strConn
            Debug.Print qdf.Connect
        End If
    Next
    
        'Refresh QueryDef
    'CurrentDb.QueryDefs.Refresh
    
Exit_GetQueryLinks:
    Set qdf = Nothing
    Exit Function

Err_GetQueryLinks:
    MsgBox Err.Number & " (" & Err.Description & ") in procedure GetQueryLinks of Module basTableLinks"
    Resume Exit_GetQueryLinks

End Function
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 20 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 20 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros