Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variables value

Status
Not open for further replies.

b00gieman

Programmer
Jul 9, 2007
60
DE
Hi,

I have the following code:

Code:
ID=Request.QueryString("ID_No")
....
if(....) then
.......
if ID>0 then
   ........
else
    .......
end if

end if

My problem is the following:in the if condition , the ID variable has lost its value.Am I doing something wrong?
 
>My problem is the following:in the if condition , the ID variable has lost its value.Am I doing something wrong?
Not possible under normal circumstances. How do you know it lost its value.

>ID=Request.QueryString("ID_No")
>if ID>0 then
On the face of these two lines, if ID is not numeric, it would be a runtime error on the server. You have to ascertain this fact to secure the script.
[tt]
[red]'[/red]if ID>0 then 'replaced by the following
if isnumeric(ID) then
if clng(ID)>0 then 'or simply ID>0, up to you
'etc
else
'etc
end if
else
'determine what you want
end if
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top