Connecting to Access Database Placed in Sharepoint from Excel VBA code

Hi All,

I am trying a Tricky one here, Request your help on the same.
I have access 2007 Data base, Present in Share point. I have a Excel macro which Interacts with Access Database. This works fine as long as both Excel Macro and Access Database are in Local Folder or Share drive, But i want to Keep both Excel Macro and Data Base in Sharepoint, and Excel should Connect to Access Data Base, here is my code snippet.

DBPath = ThisWorkbook.Path & "" & "Sample.accdb"
'Workbook Path is https://example.com/Sites/Sample/Sample.XLSM

Set Conn = New ADODB.Connection
Conn.Mode = adModeReadWrite

sconnect = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & DBPath & ";Persist Security Info=False;"

This gives me error as "Invalid File Name". Please help how do i connect to Access data from Excel in Share point.

0 answers