View Full Version : while / if ?

10-12-2007, 08:53 AM
this is a while loop as you see...i need if statment casue if "not rstemp.eof" there will be only one result...how can i wrote this like if?

dim citv, mySQL, conntemp, rstemp
mySQL="SELECT sonpass,agentcode FROM crmagents WHERE agentcode='" & pagent & "'"
call getFromDatabase(mySQL, rstemp, "citiess.asp")
do while not rstemp.eof
citv = rstemp("sonpass")
if ppassw=citv then
response.write "<BR>all the list goes here" & citv & "------" & ppassw & "<br>"
response.redirect "agentreg00.asp?message="& Server.Urlencode("you typed wrong password")
end if


10-12-2007, 10:02 AM
Change "do while" to "if", and put "then" after "eof". Take out "rstemp.movenext" and change "loop" to "end if".

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum