Groups | Blog | Home
all groups > inetserver asp db > september 2007 >

inetserver asp db : Type mismatch?


zz12
9/26/2007 5:01:36 PM
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
9/27/2007 4:54:28 AM
Gazing into my crystal ball I observed "zz12"
<IDontLikeSpam@Nowhere.com> writing in
news:ObGLPmJAIHA.536@TK2MSFTNGP06.phx.gbl:

[quoted text, click to view]

What does upsadmincheck look like? What happens if you run the query in
QA?


--
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
9/27/2007 9:04:18 AM
[quoted text, click to view]

Why do you "Set rsAdminCheck=" twice?

zz12
9/27/2007 10:28:37 AM
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.


[quoted text, click to view]

AddThis Social Bookmark Button