I have a Db located in a sharepoint folder and I am struggling getting a connection to open.
I have an Excel front end file which needs to query and write to this database.
When building in test mode on my desktop, the following in the Excel front end file worked perfectly well and the connection was established
Now the Db file is in a SharePoint folder, the
command produces an 'Automation Error'. I am confident I have the correct folder names in the strPath as this will be a constant variable (the Db file will always be kept in one place) so I am unsure as to why the connection won't work. A bit more info - I previously stated the 'https:' in the SharePoint folder location and the automation error displayed instantly. I have taken the 'https:' out so there is just '//foldername/etc/etc' and this thinks about it for 10 seconds then produces the Automation error.
TIA
I have an Excel front end file which needs to query and write to this database.
When building in test mode on my desktop, the following in the Excel front end file worked perfectly well and the connection was established
Code:
Public Const strDbFile = "Drivers Master List.accdb"
Sub ADODBConn()
Dim strPath As String
strPath = ActiveWorkbook.Path
Set cnConnection = CreateObject("ADODB.Connection")
strDbName = strPath & "/" & strDbFile
cnConnection.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & strDbName
Now the Db file is in a SharePoint folder, the
Code:
cnConnection.Open
TIA