Automate Sharepoint login in ms access

  • Hello,
    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?

  • administrators

    Hello @Mustapha-Aliyu ,

    I guess your sharepoint list uses Basic authentication 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.

  • Hello @ranjithkumar10
    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
                'set the linked table to update the link
                DoCmd.SelectObject acTable, tdf.Name, True
                'refresh the link
                DoCmd.RunCommand acCmdRefreshSharePointList
            End If
            End If
        Set tdf = Nothing
        Set db = Nothing
    End Sub

  • administrators

    @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 -

    Make sure that your connection string is correct.

Log in to reply

Looks like your connection to Codingislove Forum was lost, please wait while we try to reconnect.