In the following code, I am trying to get connection to the active directory as well as authenticating the user by giving the user's credentials.
Dim conn As New ADODB.Connection
Dim cmd As New ADODB.Command
conn.Provider = "ADsDSObject"
conn.Open "Active Directory Provider", username, password ' --> username and password are declared globally
If either or both username and password is incorrect, then will the above statement return any error or error code that I can capture.
If this is a bad idea to authenticate users, then can you please suggest another solution where I can authenticate the user as well as get that user's information from the active directory, with a more generic base url or connection string to connect to the active directory.