Here is my situation. I have ASPX pages accessing SQL Server 2000. Is it possible to use the user names in the sysusers table to get their email address through code?
Example:
sysuser table (not all columns are shown)
[tt]ID UserName
1 jmichaels
2 tsmith
3 djones[/tt]
through stored procs and ASP I would like to get their email address
[tt]jmeckley = jon_michaels@work.com
tsmith = tom_smith@work.com
djones = deb_jones@work.com[/tt]
I found IADsUser in the help files, but I cannot figure out how to use it, or what the agruements mean. The example from the help file said:
[tt]Dim usr As IADsUser
Set usr = GetObject("WinNT://Microsoft/JSmith,user"
fulNamb = usr.EmailAddress[/tt]
When I entered this into my code file IADsUser gave me an error: [tt]Type 'AIDsUser' is not defined[/tt]. My guess is I am not calling it from the correct location. I may need something like ???.???.IADsUser I don't know what the other things are though.
The other piece I do not understand is the arguement passed to GetObject [tt]"WinNT://Microsoft/JSmith,user"[/tt]. What is this, and how would the path vary for 2K and XP operating systems? The IADsUser type has many other values you can get, email is the one I am looking for.
Maybe I am on to something, maybe I am way off. Thank you in advance for any input you have.
Jason Meckley
Database Analyst
WITF
Example:
sysuser table (not all columns are shown)
[tt]ID UserName
1 jmichaels
2 tsmith
3 djones[/tt]
through stored procs and ASP I would like to get their email address
[tt]jmeckley = jon_michaels@work.com
tsmith = tom_smith@work.com
djones = deb_jones@work.com[/tt]
I found IADsUser in the help files, but I cannot figure out how to use it, or what the agruements mean. The example from the help file said:
[tt]Dim usr As IADsUser
Set usr = GetObject("WinNT://Microsoft/JSmith,user"
fulNamb = usr.EmailAddress[/tt]
When I entered this into my code file IADsUser gave me an error: [tt]Type 'AIDsUser' is not defined[/tt]. My guess is I am not calling it from the correct location. I may need something like ???.???.IADsUser I don't know what the other things are though.
The other piece I do not understand is the arguement passed to GetObject [tt]"WinNT://Microsoft/JSmith,user"[/tt]. What is this, and how would the path vary for 2K and XP operating systems? The IADsUser type has many other values you can get, email is the one I am looking for.
Maybe I am on to something, maybe I am way off. Thank you in advance for any input you have.
Jason Meckley
Database Analyst
WITF