473,320 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

nested ifs and end ifs and elses

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??
Jul 19 '05 #1
2 1450
'tis ok.

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

always find it after I post a request for help
Jul 19 '05 #2
F
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.

"Alistair" <forget_it> wrote in message
news:10*************@corp.supernews.com...
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??

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Glen | last post by:
I have a Struts action form which contains a bean. I am trying to display a bean retrieved from the database in this form using the nested tag. Can anyone help me? I continue to get an error...
6
by: Andy Baker | last post by:
Hi there, I'm learning Python at the moment and trying to grok the thinking behind it's scoping and nesting rules. I was googling for nested functions and found this Guido quote:...
3
by: Erik Bongers | last post by:
Hi, Nested classes only seem to be able to access static members of the surrounding class : class SurroundingClass { public: class InnerClass { public:
6
by: B0nj | last post by:
I've got a class in which I want to implement a property that operates like an indexer, for the various colors associated with the class. For instance, I want to be able to do 'set' operations...
8
by: Robert W. | last post by:
I've almost completed building a Model-View-Controller but have run into a snag. When an event is fired on a form control I want to automatically updated the "connnected" property in the Model. ...
17
by: J-T | last post by:
I have a class which it has 10 properties, and each property needs to be validated against 5 different validation rules.I ended up writing a lot of IF and elses statement which has made my code so...
1
by: Tomas Sieger | last post by:
Hi all, I'm in doubt with the following code: class Base { public: class Nested {}; }; class Derived:public Base { public: class Nested {
77
by: Peter Olcott | last post by:
http://www.tommti-systems.de/go.html?http://www.tommti-systems.de/main-Dateien/reviews/languages/benchmarks.html The above link shows that C# is 450% slower on something as simple as a nested loop....
25
by: GY2 | last post by:
I writing some documentation and I want to describe a common code structure which is used to step through all the items in a collection (e.g. each file in a subdirectory) while applying more and...
3
by: jdurancomas | last post by:
Dear all, I'm trying to declare the operator++ to a nested class. The nested class is not template but the container it is. The code used in teh sample program is included bellow: ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.