J
Joanne
Hello, I am trying to make a connection to Active directory from within VBA.
I set up the following:
Set ConName = CreateObject("ADODB.Connection")
Set cmd = CreateObject("ADODB.command")
Set rst = CreateObject("ADODB.RecordSet")
ConName.Provider = "ADsDSOObject"
ConName.Open
'cmd.CommandText = "<LDAP://DC=kenyon,DC=com>;(cn=JHoersch);name, ADsPath"
cmd.CommandText = "LDAP://DC=kenyon,DC=com;(cn=JHoersch);name, ADsPath"
Set rst = cmd.Execute
vName = rst.Fields("name")
MsgBox "VName is equal to " & vName
I get an error that the connection cannot be made. I'm just guessing at the
format for this because I can't find anything on the internet that will give
me the correct format. PLEASE HELP! I posted this earlier but have gotten no
response. Thank you very much.
I set up the following:
Set ConName = CreateObject("ADODB.Connection")
Set cmd = CreateObject("ADODB.command")
Set rst = CreateObject("ADODB.RecordSet")
ConName.Provider = "ADsDSOObject"
ConName.Open
'cmd.CommandText = "<LDAP://DC=kenyon,DC=com>;(cn=JHoersch);name, ADsPath"
cmd.CommandText = "LDAP://DC=kenyon,DC=com;(cn=JHoersch);name, ADsPath"
Set rst = cmd.Execute
vName = rst.Fields("name")
MsgBox "VName is equal to " & vName
I get an error that the connection cannot be made. I'm just guessing at the
format for this because I can't find anything on the internet that will give
me the correct format. PLEASE HELP! I posted this earlier but have gotten no
response. Thank you very much.