Scotster
Board Regular
- Joined
- May 29, 2017
- Messages
- 59
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
Hi there,
I'm migrating an entire suite of excel files that currently access a database in order to see if a person is allowed access. I use an ADODB connection and it works great. I'm hoping that I can use the "Lists" feature in Sharepoint to copy this access solution but I'm really struggling with finding out the correct syntax.
What I have now is as follows:
The main things I'm unsure of are the Sharepoint site, the "LIST" and with those combined, how to select the "Table" for the record set.
For the site, the full link (redacted) to the table is as follows:
I have the correct list ID which I got from Sharepoint settings {xxxx-xxxx-xxxx-xxxx} etc.
Typically for the connection I would want to select the "Database" name, in this case I'm not sure what it's called. Is it called Lists? FileAccess (from what I understand) is the Table name.
To summarise:
strSharepointSite = "[https://website.com/sites/Project/]" - I'm unsure what this should be given the link above?
LIST=FileAccess - I really want this to be the DB but unsure how to reference/
.Open "SELECT * FROM TABLE" - I really want this to be the FileAccess table but need the correct List first.
Any help would be greatly appreciated.
I'm migrating an entire suite of excel files that currently access a database in order to see if a person is allowed access. I use an ADODB connection and it works great. I'm hoping that I can use the "Lists" feature in Sharepoint to copy this access solution but I'm really struggling with finding out the correct syntax.
What I have now is as follows:
Code:
Dim cnt As ADODB.Connection
Dim mySQL As String
Dim strSharepointListID As String, strSharepointSite As String
strSharepointListID = "{Removed}"
strSharepointSite = "[https://Website.com/sites/Project/]"
Set cnt = New ADODB.Connection
With cnt
.ConnectionString = _
"Provider=Microsoft.ACE.OLEDB.12.0;WSS;IMEX=0;RetrieveIds=Yes;DATABASE=" & strSharepointSite '& ";LIST=FileAccess;"
.Open
End With
Set rs = New ADODB.Recordset
i = 2
With rs
.ActiveConnection = cnt
.Open "SELECT * FROM TABLE"
For i = 1 To .Fields.Count
Debug.Print .Fields(i - 1).Name
Debug.Print .Fields(i - 1).Type
Next i
End With
The main things I'm unsure of are the Sharepoint site, the "LIST" and with those combined, how to select the "Table" for the record set.
For the site, the full link (redacted) to the table is as follows:
I have the correct list ID which I got from Sharepoint settings {xxxx-xxxx-xxxx-xxxx} etc.
Typically for the connection I would want to select the "Database" name, in this case I'm not sure what it's called. Is it called Lists? FileAccess (from what I understand) is the Table name.
To summarise:
strSharepointSite = "[https://website.com/sites/Project/]" - I'm unsure what this should be given the link above?
LIST=FileAccess - I really want this to be the DB but unsure how to reference/
.Open "SELECT * FROM TABLE" - I really want this to be the FileAccess table but need the correct List first.
Any help would be greatly appreciated.