I have two data connections to different queries in the same Access DB. The second one always fails (regardless of which I run first).
When I look at the database, I no
I was faced with another issue regarding data connections, and the solution for it actually ended up fixing this long-standing issue as well!
My guess is that the secret lies in "MaintainConnection = False":
Dim i As Integer
Dim awc As WorkbookConnection
Dim c As OLEDBConnection
For i = 0 to ActiveWorkbook.Connections.Count
Set awc = ActiveWorkbook.Connections.Item(i)
Set c = awc.OLEDBConnection
c.EnableRefresh = True
c.BackgroundQuery = False
c.Reconnect
c.Refresh
c.MaintainConnection = False
Next i