Automate Sharepoint login in ms access
I am new to this forum and i really enjoy your swift response. I have a small program designed to get data from different locations. A table in the program is linked to sharepoint list online. When the program is installed on another computer, sharepoint login pops up and asks user to enter username and password. I dont want to give the end users the sharepoint details. Is there any way I can automate that login as it is mostly required just once for setu?
Hello @Mustapha-Aliyu ,
I guess your sharepoint list uses
Basicauthentication which can be bypassed by making a POST request with username and password just before you call for data.
Can you share few lines of code which calls SharePoint list? I can have a look and let you know.
the program I have make use of a table linked to sharepoint. So anytime the program is installed on a new computer, access/access runtime pops up a sharepoint login so the username and password of the sharepoint where the list is located is entered. So i created a refresh module below but it still asks for that
Sub LoopTableDef() Dim db As DAO.Database Dim ln As Long, tblName As String, rs As Recordset Dim tdf As DAO.TableDef Set db = CurrentDb For Each tdf In db.TableDefs If Left(tdf.Connect, 3) = "WSS" Then If (tdf.Name = "SchoolList") Or (tdf.Name = "RegistrationJs") Or (tdf.Name = "Userinfo") Then tdf.RefreshLink 'set the linked table to update the link DoCmd.SelectObject acTable, tdf.Name, True 'refresh the link DoCmd.RunCommand acCmdRefreshSharePointList End If End If Next Set tdf = Nothing Set db = Nothing End Sub
@Mustapha-Aliyu Looks like you are not providing password in the connection string. According to docs, Login box is displayed only if password is not specified in connection string - https://msdn.microsoft.com/en-us/library/bb221162(v=office.12).aspx
Make sure that your connection string is correct.