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

Displaying of Variables 1

Status
Not open for further replies.

minoad

Programmer
Mar 28, 2001
138
US
I am using a database entry regarding the Sex (M or F) to decide on whether the salutaion gets a Mr. or a Mrs.. I have run this code with no errors so i believe it is fine. My problem is getting a variable to write. The variable is Sexx, i have tried ' Response.Write(sexx) to no avail. Any ideas? HEre is the code.

set sex = conn("Patinet Sex")
If Sex = M Then
Set Sexx= "Mr"
ElseIf Sex = F Then
Set Sexx= "Mrs"
End If
 
If your variables are strings, then you need to enclose them in quotes:

If Sex = "M" Then


see if that works --

if you are response.write'ing the sexx, then it is doing it, I suspect that the variable is simply empty due to neither of your conditions being satisfied.

:)
 
You use the set verb to assign an object to a variable and you can't response.write an object. I suspect you have more problems than that, but, for one, change the set sexx = "Mr." to just sexx = "Mr.".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top