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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing string values

Status
Not open for further replies.

pilg

Programmer
Feb 16, 2001
82
GB
Hi,

I need to compare two string values.

The way I am doing this at the moment is:

session("graph") = Request.form.item("graph")
graph = session("graph")
session("employee") = Request.form.item("staff")
staff = session ("employee")
Team = SPECS Team

If staff = Team then

set objconnteam = server.CreateObject ("ADODB.Connection")

Objconnteam.Open "FILEDSN=SPECSFeedback;"

Set objRSteam = server.CreateObject ("ADODB.recordset")


.... and so on.

What I actually do is read in a value recieved from the previous form into the variable team I then need to perform an IF on this string i.e. if it is = to SPECS Team then perform the IF if not then continue.

Am I doing this correctly?

It's just my page will not display and I can't see any problems.

Hope you can help.

Cheers,

Pilg.

 
I would add in some response.write statements to verify that the values you are expecting to show up are indeed there. For example:

response.write request.form.item(&quot;graph&quot;) & &quot; is graph<br>&quot;
response.write request.form.item(&quot;staff&quot;) & &quot; is staff<br>&quot;

and then write the rest of your code as you've done in order to make sure that you are getting the values you're expecting. Presumably these are both strings, else if they are different variable types you would need to declare these prior to comparison.

--------------------------------------------------------------------------------------------------------------------------
Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so.
--Douglas Adams
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top