Link to home
Start Free TrialLog in
Avatar of Shanan212
Shanan212Flag for Canada

asked on

Access Opens with Ready-Only Access when opened via VBA

   DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, _
    "TEMP", "C:\Users\userA\Desktop\" & iName, True


I have the above code in a VBA module inside Access.

I also have read/write access to the database (and its folder) that was opened prior to this code via the following code

    Dim Ac As Object
    Set Ac = CreateObject("Access.Application")

    Ac.Visible = False
    Ac.OpenCurrentDatabase ("\\Fileserver\Everyone\Engineering Database\Database\NM Probill Database\NM Probill Database.accdb")

Open in new window

My problem is, 1/10 times, the database is opened as 'Read-Only' while no-one else is accessing it. This is creating problems for the appending query above.

How do I resolve this? How do I make it force open as 'read-write'?

Thanks for your time!
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This could be caused by phantom hidden access sessions that can be created if you don't release your ac object variable, or if you don't ac.quit when you are done.
Avatar of Shanan212


That worked! Thanks all!