-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: sat417
Message 1 in Discussion
Hi friends,
I am not able to retrieve emailid for the logged user, please find the code below.
same code works for other domain 'MOP.DCE.COM'
I am not able to find why it is not retrieving user email id from 'ABC.DEF.COM domain.
I am calling a function Validate() which validates the user credentials.. then I am
calling below code to retrieve email id....I debugged the code and found "type
mismatch" error.. i tried to save the email id to variable which is of variant .. but
still that error occurs... Please help in resolving this.
regards
satish
ASP Code
==========
Dim con, rs, Com, user, objADsPath, objDomain, objADOU
dim pstrDomain
pstrDomain = "abc" 'Domain name
pstrPath = "dc=abc,dc=def,dc=cpm" 'Fully qualified name abc.def.com
pStremailid= "John"
On Error Resume Next
objADsPath = "GC://" & pstrDomain & "/" & pstrPath
Set objDomain = GetObject(objADsPath)
Set objDomain = Nothing
Set con = CreateObject("ADODB.Connection")
con.Provider = "ADsDSOObject"
con.Open "Active Directory Provider"
Set Com = CreateObject("ADODB.Command")
Set Com.ActiveConnection = con
Com.CommandText = "select mail from '" & objADsPath & "' where sAMAccountname='" &
pStremailid & "'"
Set rs = Com.Execute
If Not rs.EOF Then
If rs("mail") Is Not Null Then
strEmailid = rs("mail")
End If
End If
rs.Close
If Not rs Is Nothing Then Set rs = Nothing
If Not con Is Nothing Then Set con = Nothing
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]