• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Can't Refresh two Connections to same Access DB

Roseus

New Member
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 notice that it has a lock file after I attempt the Refresh (not before), which I think is causing the problem. It stays locked until I close the Excel file. Please help me kill Excel's lock on the DB so I can run the second Refresh.

The Refresh is triggered using VBA, and I'm assuming the solution will, too.

I was hoping something like this would suffice, but no dice:

Code:
ActiveWorkbook.Connections("MyConnection").Refresh
ActiveWorkbook.Connections("MyConnection").Close
ActiveWorkbook.Connections("2ndConnection").Refresh

# # #
Additional Info
I'm using Excel and Access 2010.​
The connections aren't in VBA, they were made through Data > Connections. Further, I'm not using SQL from Excel, I'm using Command Type: Table.​
The error:​
The text file specification 'MyQuery Link Specification' does not exist. You cannot import, export, or link using the specification.

Connection String

Code:
Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin
;Data Source=A:\folder\folder\My Database.accdb
;Mode=Read;Extended Properties=""
;Jet OLEDB:System database=""
;Jet OLEDB:Registry Path=""
;Jet OLEDB:Engine Type=6
;Jet OLEDB:Database Locking Mode=0
;Jet OLEDB:Global Partial Bulk Ops=2
;Jet OLEDB:Global Bulk Transactions=1
;Jet OLEDB:New Database Password=""
;Jet OLEDB:Create System Database=False
;Jet OLEDB:Encrypt Database=False
;Jet OLEDB:Don't Copy Locale on Compact=False
;Jet OLEDB:Compact Without Replica Repair=False
;Jet OLEDB:SFP=False
;Jet OLEDB:Support Complex Data=False
;Jet OLEDB:Bypass UserInfo Validation=False

This question is a cross-post from here (8 days ago). I'm new to the forum, but a long time reader. Any help you can provide is really appreciated!

 
Back
Top