I have an Access database residing on a network server and an Excel workbook in the same folder. The Excel workbook is used by my department to book equipment and rooms, with the booking information stored in the database.
For some users (me included) it always works as intended, whether I'm directly connected to the network or logged in remotely. For others, it fails to open a connection to the database.
The code references Microsoft ActiveX Data Objects 6.1 Library
The code at issue is as follows , shortened to remove attempts at error-catching and retries
Code: Select all
Sub OpenDatabase(adMode as ConnectModeEnum) set bookings = New ADODB.Connection 'bookings defined globally with bookings .Provider = "Microsoft.ACE.OLEDB.12" .Properties("Data Source") = Thisworkbook.Path & "\dbname.accdb" .Mode = adMode 'either adModeRead or adModeShareDenyNone, depending whether reading or writing .Open end with end sub
The questions are:
has anyone else seen this behaviour or know of it?
is there a solution?
is there a work-around?
Thanks in advance