get uid info?

  • From: "LIONEL" <lionel@xxxxxxxxxxxxx>
  • To: exchangelist@xxxxxxxxxxxxx
  • Date: Thu, 3 Jan 2002 08:17:19 -0700

Hi..

The code below works fine before.
After I update my exchange for 5.5 to 2000(NT 4.0 - Windows 2000 Server),
the com.execute return  Err:
Run-time error '2147217865': Table does not exist.

Is that LDAP port problem?

I can't change the port number because my exchange 2000 is running as 
mail server only, and the active directory info is running on a Domain
controller. So how can I change to code to get uid and mail.

Please help!

Thanks.


Private Sub Command1_Click()
 Set con = CreateObject("ADODB.Connection")
 Set Com = CreateObject("ADODB.Command")

'Open a Connection object
con.Provider = "ADsDSOObject"

'---------------------------------------------------------------------------

---
' If you want to be authenticated as someone other than currently logged
on
user
' use the connection properties of User ID and Password.
'---------------------------------------------------------------------------

---
con.Properties("User ID") = "domain\user"
con.Properties("Password") = ""

'----------------------
' Open the connection.
'----------------------
con.Open "Active Directory Provider"

'Create a command object on this connection
Set Com.ActiveConnection = con

'---------------------
'Set the query string.
'---------------------

adDomainPath = "LDAP://exchangname";
searchAlias = "xx"
Com.CommandText = "select ADsPath, uid, title, givenName, sn,
physicalDeliveryOfficeName,telephoneNumber from '" & adDomainPath & "'
where
uid='" & searchAlias & "'"

'-------------------------------
'Set the preferences for search.
'-------------------------------
Com.Properties("Page Size") = 100
...

'-------------------
'Execute the query.
'-------------------
Set rs = Com.Execute
...
End Sub



Other related posts:

  • » get uid info?