P
PatK
I have found that when working with linked sharepoint 2007 tables, in Access
2007, that table changes on the sharepoint side do not, real time, show up in
the linked table on the Access side. I have this code that I am attempting
to basically "refresh" my links, by deleting, and then relinking the tables
before critical code is run that relies on "latest" data:
Sub refreshSharepointTables()
'----------------------------------------------------------------------------
' experimental: Refresh of Assets & CI sharepoint links (not currently used)
'----------------------------------------------------------------------------
' First delete the existing CI Table Link
'----------------------------------------------------------------------------
unlinkWS ("CI Data")
'----------------------------------------------------------------------------
' Next relink the table
'----------------------------------------------------------------------------
DoCmd.TransferDatabase acLink, "WSS", "WSS;HDR=NO;IMEX=2;" & _
"DATABASE=http://teams1.sharepoint.hp.com/teams/IPGassets;" & _
"LIST={9CE103C0-D36A-4E6B-96E4-77DA4AA9650C};" & _
"VIEW=;RetrieveIds=Yes;TABLE=CI Data", acTable, , _
"CI Data"
End Sub
Sub unlinkWS(WSName As String)
'--------------------------------------------------------------------------
' After successful processing, unlink the excel worksheet
'-------------------------------------------------------------------------
DoCmd.DeleteObject acTable, WSName
End Sub
While the do.Cmd.transferdatabase codes work "perfectly", the unlinkWS
subroutine, that I used to delete the tables, before linking, does not. It
returns a "Run-time error '2387': You cannot delete the table 'CI Data'; it
is participating in one or more relationships".
THe problem is that there are actually no relationships to other tables
(when I bring up the relationships map). Any idea what is happening here?
Patk
2007, that table changes on the sharepoint side do not, real time, show up in
the linked table on the Access side. I have this code that I am attempting
to basically "refresh" my links, by deleting, and then relinking the tables
before critical code is run that relies on "latest" data:
Sub refreshSharepointTables()
'----------------------------------------------------------------------------
' experimental: Refresh of Assets & CI sharepoint links (not currently used)
'----------------------------------------------------------------------------
' First delete the existing CI Table Link
'----------------------------------------------------------------------------
unlinkWS ("CI Data")
'----------------------------------------------------------------------------
' Next relink the table
'----------------------------------------------------------------------------
DoCmd.TransferDatabase acLink, "WSS", "WSS;HDR=NO;IMEX=2;" & _
"DATABASE=http://teams1.sharepoint.hp.com/teams/IPGassets;" & _
"LIST={9CE103C0-D36A-4E6B-96E4-77DA4AA9650C};" & _
"VIEW=;RetrieveIds=Yes;TABLE=CI Data", acTable, , _
"CI Data"
End Sub
Sub unlinkWS(WSName As String)
'--------------------------------------------------------------------------
' After successful processing, unlink the excel worksheet
'-------------------------------------------------------------------------
DoCmd.DeleteObject acTable, WSName
End Sub
While the do.Cmd.transferdatabase codes work "perfectly", the unlinkWS
subroutine, that I used to delete the tables, before linking, does not. It
returns a "Run-time error '2387': You cannot delete the table 'CI Data'; it
is participating in one or more relationships".
THe problem is that there are actually no relationships to other tables
(when I bring up the relationships map). Any idea what is happening here?
Patk