nested ifs and end ifs and elses

nested ifs and end ifs and elses

Post by Alistai » Thu, 06 May 2004 19:34:52


still working on this DB :o(

I have..

a query that I run, if this query is unsuccessful then another query is run
on another table, it goes something like this


if rs1.EOF then '1st query returns nothing

response.write "nothing in this table"

'so check the other table
strSQL = "SELECT * blah blah
rs.Open strSQL, Conn, 1

if rs.EOF then '2nd query also returns nothing
response.write "nothing in this table either"

else

do while not rs.EOF
reg = rs("reg_num")
l_read = rs("last_read")
response.write blah blah

end if

else

do while not rs1.EOF
strname = rs1("user_name")
response.write blah blah

rs1.movenext
loop

end if

but I get an expected statement (end if) error

I'm looking at my code it it seems to conform to the correct structure

if condition1 then
code block1
if condition2 then
codeblock2
else
codeblock3
end if
else
codeblock4
end if

should I perhaps have used elseif??
 
 
 

nested ifs and end ifs and elses

Post by Alistai » Thu, 06 May 2004 19:41:51

'tis ok.

I've found it....a missing loop

always find it after I post a request for help

 
 
 

nested ifs and end ifs and elses

Post by » Thu, 06 May 2004 19:42:58

what about "loop" ?

loop syntex is missing in one of your do while statement. Try it may be it
works if not let us know.





run