Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ASP / Database Access / September 2007



Tip: Looking for answers? Try searching our database.

Type mismatch?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
zz12 - 27 Sep 2007 01:01 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
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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.