Link to home
Start Free TrialLog in
Avatar of Russellbrown
RussellbrownFlag for United States of America

asked on

MS Access Linked Table to SharePoint - Broken Link

I am able to link lists in SharePoint to MS Access programmatically with VBA. Extract of the code as follows:
Dim GUID, AccountChoice As String
ListChoice = [       ]    ' the VBA code can grab the ListChoice
GUID  = [       ]   ‘ the VBA code can grab the GUID

DoCmd.TransferDatabase acLink, "WSS", "WSS;HDR=NO;IMEX=2;DATABASE=servername/;LIST=" & GUID & ";VIEW=;RetrieveIds=Yes;TABLE=" & ListChoice, acTable, , ListChoice
Assuming 5 lists have been created in SharePoint and linked to MS Access ( i.e.  List1, List2, List3, List4 and List5 ). Somewhere down the road, List5 is deleted in SharePoint and is re-created with the same name ( but now with a new GUID ).

In the MS Access DB, the linked table, List5 – the link would have been broken as it was pointing to a GUID that has been deleted.

My questions: How can I programmatically ( using VBA  in MS Access)
1.      test in the case of List5, whether the link is broken ( or its equivalent ),
2.      And if the link is broken,  how to delete the linked table,  List5 in the MS Access DB.  


Thank you in advance for your assistance.
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial