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!

Comparing RecordSet value to Querystring value 1

Status
Not open for further replies.

Maldini

Technical User
Nov 10, 2002
55
0
0
GB
Hi,

Is this possible?
What I'm trying to do is a simple:

If Rst1("ID") = Request.Querystring("PassedID") Then
// Run some code
Else
// Run something else
End If

However, I've tried replacing the querystring with a variable, wrapping the recordset with quotes, but nothing seems to work.

Any tips?

Thanks.

Maldini
 
Try this:

rid=Trim(Rst1("ID"))
If Request.Querystring("PassedID")=rid Then

-DNG
 
If the value is an integer and not a string then you will need to convert the querystring value into an integer before you make the comparison:
Code:
If Rst1("ID") = [red]CInt([/red]Request.Querystring("PassedID")[red])[/red] Then
// Run some code
Else
// Run something else
End If

Tony
_______________________________________________________________
 
Thanks, the conversion to integer was exactly what was lacking; it works now. :)
Maldini
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top