Link to SharePoint list

gblack

Registered User.
Local time
Today, 23:46
Joined
Sep 18, 2002
Messages
632
I would be forever in someone's debt if they could please post code to break and then re-establish a link to a sharepoint list? I am pulling my hair out trying to find it.

Thanks,
Gary

PS. The SharePoint refresh method does not do the trick:

DoCmd.SelectObject acTable, "SP_Repository", True
DoCmd.RunCommand acCmdRefreshSharePointList

I need to break the link entirely and create a new one.
 
Nevermind, I found it:

'This deletes the link
DoCmd.DeleteObject acTable, "SP_Repository"


'This re/creates the link
DoCmd.TransferDatabase acLink, "WSS", _
"WSS;HDR=NO;IMEX=2;" & _
"DATABASE=http://sps.some.url.for.sharepoint;" & _
"LIST={9X99999X-XXX9-999X-9X99-9X9X99X99X99};" & _
"VIEW=;RetrieveIds=Yes;TABLE=SP_Repository", acTable, , _
"SP_Repository"
 
Thanks for posting your resolution for I think I might need this one day. I am curious if this is something that you need to do often or a one time fix?
 
Well the issue was that I was pushing a report out to the SharePoint site in PDF format, then trying to update the metadata on the SP side by looping through the linked SharePoint list in Access.

Unfortunately the list would not update until either Access closed and reopened, or I broke the link and then reestablished it.

Meaning... when looping through the SP List, Access would never find the document name that was just push out to the SP site.

Even though there was a record for it, Access always saw the Document Name field as a null value, but breaking and reestablishing the link allowed this field to refresh somehow and thusly my recordset didn't throw a null error. Plus I needed that field name to sync up with the document name I just exported (if that makes any sense).

I know there's probably a much better way to do this refresh (and please feel free to post it if you have it). I'd really like to know a better way to do this, but for me, breaking the link and then relinking the SP list seems to work for now.

I also tried refreshing the link (see initial post), but that didn't do anything.

Thanks,
Gary
 

Users who are viewing this thread

Back
Top Bottom