[thelist] ok, simple asp string compare problem.

Joshua Olson joshua at waetech.com
Thu Oct 14 15:35:40 CDT 2004


> -----Original Message-----
> From: Brian Delaney
> Sent: Thursday, October 14, 2004 3:28 PM
> 
> I am brain dead and probably just missing something:
> 
> I have a user select from a drop down list:
> 
> <option value="1">IT Admin</option>
> 
> Then I get the adminperm value from the sql db. In this case 
> it is equal to 1 this is stored in the objRS.
> 
> What happens is even though this statement is true: *IF 
> objRS("adminperm")= Request.Form("txtAPP") Then
> * it always falls to the else "you donot have proper permission"
> ????

You are most likely comparing numerics to strings, which will fail.  Two
things you can do:

If objRS("adminperm") = CLng(Request.form("txtAPP")) Then

Or

If "" & objRS("adminperm") = Request.form("txtAPP") Then

Your call.

<><><><><><><><><><>
Joshua Olson
Web Application Engineer
WAE Tech Inc.
http://www.waetech.com/service_areas/
706.210.0168 




More information about the thelist mailing list