Hello, would anyone tell me what's wrong with the following or if there's a
better way/practice in trying to get the current windows authenticated user
and seeing if it exists in a sql2k user table?:
Dim conn, rsAdminCheck
Set conn= CreateObject("ADODB.Connection")
Set rsAdminCheck = CreateObject("ADODB.Recordset")
conn.Open db
Set rsAdminCheck= conn.Execute("exec uspAdminCheck '" &
Request.ServerVariables("AUTH_USER") & "'")
If rsAdminCheck(0) = 1 Then '1=Yes 0=No
response.write "Yes, this user is an admin"
Else
response.write "No, this user is not an admin"
End If
It gives me the following error:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: '[string: "DomainName\TestUserName"]'
Thanks in advance.
Adrienne Boswell - 27 Sep 2007 05:54 GMT
> Hello, would anyone tell me what's wrong with the following or if
> there's a better way/practice in trying to get the current windows
[quoted text clipped - 18 lines]
>
> Thanks in advance.
What does upsadmincheck look like? What happens if you run the query in
QA?

Signature
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
McKirahan - 27 Sep 2007 15:04 GMT
> Hello, would anyone tell me what's wrong with the following or if there's a
> better way/practice in trying to get the current windows authenticated user
[quoted text clipped - 16 lines]
> Microsoft VBScript runtime (0x800A000D)
> Type mismatch: '[string: "DomainName\TestUserName"]'
Why do you "Set rsAdminCheck=" twice?
zz12 - 27 Sep 2007 18:28 GMT
Instead of getting and passing the Request.ServerVariables("AUTH_USER")
variable to sql2k I ended up doing from the backend by using and checking it
with sql2k's SUSER_SNAME() command which returns a workable recordset.
Thanks for the speedy and helpful reply anyways gentlemen. Much
appreciated.
Take cares.
>> Hello, would anyone tell me what's wrong with the following or if there's
> a
[quoted text clipped - 20 lines]
>
> Why do you "Set rsAdminCheck=" twice?