Request.QueryString 
Author Message
 Request.QueryString

I have the URL:

http://server/display.asp?cpu=1001

I am trying to use Request.QueryString("cpu") and this sets then this
puts in the 1001, but as a string. I need it as an recognized as an
integer number and not just a string. This is because it is later
compared to a SQL database field called "id"  that is a number field,
and it cant compare a 1001 string to a 1001 integer variable in the
SQL server. Help!

I am hoping there is something like Request.QueryInteger() or
something like that, anybody know of something like this?

-Bret



Thu, 11 Apr 2002 03:00:00 GMT  
 Request.QueryString


Quote:
> I am hoping there is something like Request.QueryInteger() or
> something like that, anybody know of something like this?

Bret,
    It sounds like you have the right idea using the querystring.  No,
it does not return an integer type, but you can cast its type to be an
integer using CLng or CInt.

if rs("id").value = clng(request.querystring("cpu")) then
   ...
end if

Be careful in doing this, though:  if the CPU querystring object is not
present, it will return empty to the CLng function, which will then
generate an error.  Perform some error checking first before using the
CInt or CLng functions.

--
Kirk Allen Evans

Sent via Deja.com http://www.deja.com/
Before you buy.



Mon, 15 Apr 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Need more Request.QueryString and Request.Form help

2. Can I Request.form and Request.querystring?

3. Problems with listbox and asp and request.querystring.

4. Request.QueryString

5. request.querystring in JavaScript?

6. VBScript Equivalent to Request.Querystring

7. alternative to Request.QueryString

8. Request.QueryString in Jscript?

9. Merge, Request.QueryString

10. cannot get the Request.QueryString

11. Request.QueryString help

12. Request.Querystring/Form

 

 
Powered by phpBB® Forum Software