|
 |
asp_databases thread: loop without do error
Message #1 by mpelley@c... on Tue, 16 Jul 2002 16:37:44
|
|
I am getting the strangest error from an asp script I am working on. I
am attempting to open a simple connection to a db and extract information
regarding weather or not certain educaitonal opportunities are available
to view and display them in a table.
I have done the exact same code on other pages and it works fine with
the exception of one difference on this page, I am trying to use if then
statements to allow the user to email an rsvp to someone. I am getting a
loop without do error, even though there is definitly a do statement, only
one do statement to be percise, and nothing overly complicated to
convolute the situation. I am stumped, if there is someone out there who
can help me I would really appreaciate it.
mark
<%
dha=request.form("StrDistrict")
set contoDb=Server.CreateObject("ADODB.Connection")
contoDB.ConnectionTimeout=30
contoDB.Open "DSN=Intra"
set rsedu=Server.CreateObject("ADODB.RecordSet")
strSQL= "Select * From tbl_edu where (strDistrict)='" &dha& "'"
set rsedu=contoDB.Execute(strSql)
%>
<TABLE BORDER=0>
<tr>
<TD bgcolor="#0099ff" width="71"> <div
align="center"><b><u>DHA</u></b></div></TD>
<TD width="59" bgcolor="#0099ff"> <div
align="center"><b><u>Date</u></b></div>
<div align="center"><b></b></div></TD>
<TD bgcolor="#0099ff" width="224"> <center>
<b><u>Sponsor/Session</u></b></center></TD>
<TD bgcolor="#0099ff" width="90"> <div
align="center"><b><u>RSVP</u></b></div></TD>
</TR>
<TR>
<TH COLSPAN=4> </TH>
</TR>
<font class="normal"></font>
<%
Do While Not rsedu.EOF
%>
<TR>
<TD width="71"> <center>
<B>
<% Response.Write(rsedu("strDistrict")) %>
</B> </Center></TD>
<TD> <center>
<B>
<% Response.Write(rsedu("strDate")) %>
</B>
</Center>
<center>
<B> </B> </Center></TD>
<TD width="224">
<center>
<a href= "<% =(rsedu("strPath"))%>"> <font
color="00BFFF"><B>
<% Response.Write(rsedu("strEdudoc")) %></a>
</b></font></a> </center></TD>
<TD width="90"><center>
<B>
<% If rsedu("strRsvp")=y And rsedu("strDistrict")=cha
Then%>
<a
href="mailto:mpelley@c...">RSVP</a>
<%
Else If rsedu("strRsvp")=y And rsedu("strDistrict")=cehha Then%>
<a
href="mailto:mpelley@c...">RSVP</a>
<%
Else If rsedu("strRsvp")=y And rsedu("strDistrict")=pcha Then %>
<a href="mailto:mpelley@c...">RSVP</a>
<%
Else %>
<b>N/A</b>
<%
End If %>
</b> </Center></TD>
<%
rsedu.MoveNext
Loop
%>
</table>
<% rsedu.close
set rsedu=Nothing
contodb.close
set contodb=Nothing
%>
Message #2 by "Peter Foti (PeterF)" <PeterF@S...> on Tue, 16 Jul 2002 11:39:39 -0400
|
|
Else If
should be
ElseIf
> -----Original Message-----
> From: mpelley@c... [mailto:mpelley@c...]
> Sent: Tuesday, July 16, 2002 4:38 PM
> To: ASP Databases
> Subject: [asp_databases] loop without do error
>
>
> I am getting the strangest error from an asp script I am
> working on. I
> am attempting to open a simple connection to a db and extract
> information
> regarding weather or not certain educaitonal opportunities
> are available
> to view and display them in a table.
> I have done the exact same code on other pages and it
> works fine with
> the exception of one difference on this page, I am trying to
> use if then
> statements to allow the user to email an rsvp to someone. I
> am getting a
> loop without do error, even though there is definitly a do
> statement, only
> one do statement to be percise, and nothing overly complicated to
> convolute the situation. I am stumped, if there is someone
> out there who
> can help me I would really appreaciate it.
> mark
>
>
>
> <%
> dha=request.form("StrDistrict")
> set contoDb=Server.CreateObject("ADODB.Connection")
> contoDB.ConnectionTimeout=30
> contoDB.Open "DSN=Intra"
> set rsedu=Server.CreateObject("ADODB.RecordSet")
> strSQL= "Select * From tbl_edu where (strDistrict)='"
> &dha& "'"
> set rsedu=contoDB.Execute(strSql)
> %>
>
> <TABLE BORDER=0>
> <tr>
> <TD bgcolor="#0099ff" width="71"> <div
> align="center"><b><u>DHA</u></b></div></TD>
> <TD width="59" bgcolor="#0099ff"> <div
> align="center"><b><u>Date</u></b></div>
> <div align="center"><b></b></div></TD>
> <TD bgcolor="#0099ff" width="224"> <center>
> <b><u>Sponsor/Session</u></b></center></TD>
> <TD bgcolor="#0099ff" width="90"> <div
> align="center"><b><u>RSVP</u></b></div></TD>
> </TR>
> <TR>
> <TH COLSPAN=4> </TH>
> </TR>
> <font class="normal"></font>
> <%
> Do While Not rsedu.EOF
> %>
> <TR>
> <TD width="71"> <center>
> <B>
> <% Response.Write(rsedu("strDistrict")) %>
>
> </B> </Center></TD>
> <TD> <center>
> <B>
> <% Response.Write(rsedu("strDate")) %>
>
> </B>
> </Center>
> <center>
> <B> </B> </Center></TD>
> <TD width="224">
> <center>
> <a href= "<% =(rsedu("strPath"))%>"> <font
> color="00BFFF"><B>
> <% Response.Write(rsedu("strEdudoc")) %></a>
>
> </b></font></a> </center></TD>
> <TD width="90"><center>
> <B>
> <% If rsedu("strRsvp")=y And
> rsedu("strDistrict")=cha
> Then%>
>
> <a
> href="mailto:mpelley@c...">RSVP</a>
>
> <%
> Else If rsedu("strRsvp")=y And rsedu("strDistrict")=cehha Then%>
>
> <a
> href="mailto:mpelley@c...">RSVP</a>
>
> <%
> Else If rsedu("strRsvp")=y And rsedu("strDistrict")=pcha Then %>
> <a href="mailto:mpelley@c...">RSVP</a>
>
> <%
> Else %>
>
> <b>N/A</b>
>
> <%
> End If %>
>
> </b> </Center></TD>
>
>
> <%
> rsedu.MoveNext
> Loop
> %>
> </table>
> <% rsedu.close
> set rsedu=Nothing
> contodb.close
> set contodb=Nothing
> %>
>
Message #3 by "Sheets, Kim" <kim.sheets@e...> on Tue, 16 Jul 2002 10:36:03 -0500
|
|
I am seeing nested if/else statements but only a single end if before the
loop. For each if you should have an end if.
-----Original Message-----
From: mpelley@c... [mailto:mpelley@c...]
Sent: Tuesday, July 16, 2002 11:38 AM
To: ASP Databases
Subject: [asp_databases] loop without do error
I am getting the strangest error from an asp script I am working on. I
am attempting to open a simple connection to a db and extract information
regarding weather or not certain educaitonal opportunities are available
to view and display them in a table.
I have done the exact same code on other pages and it works fine with
the exception of one difference on this page, I am trying to use if then
statements to allow the user to email an rsvp to someone. I am getting a
loop without do error, even though there is definitly a do statement, only
one do statement to be percise, and nothing overly complicated to
convolute the situation. I am stumped, if there is someone out there who
can help me I would really appreaciate it.
mark
<%
dha=request.form("StrDistrict")
set contoDb=Server.CreateObject("ADODB.Connection")
contoDB.ConnectionTimeout=30
contoDB.Open "DSN=Intra"
set rsedu=Server.CreateObject("ADODB.RecordSet")
strSQL= "Select * From tbl_edu where (strDistrict)='" &dha& "'"
set rsedu=contoDB.Execute(strSql)
%>
<TABLE BORDER=0>
<tr>
<TD bgcolor="#0099ff" width="71"> <div
align="center"><b><u>DHA</u></b></div></TD>
<TD width="59" bgcolor="#0099ff"> <div
align="center"><b><u>Date</u></b></div>
<div align="center"><b></b></div></TD>
<TD bgcolor="#0099ff" width="224"> <center>
<b><u>Sponsor/Session</u></b></center></TD>
<TD bgcolor="#0099ff" width="90"> <div
align="center"><b><u>RSVP</u></b></div></TD>
</TR>
<TR>
<TH COLSPAN=4> </TH>
</TR>
<font class="normal"></font>
<%
Do While Not rsedu.EOF
%>
<TR>
<TD width="71"> <center>
<B>
<% Response.Write(rsedu("strDistrict")) %>
</B> </Center></TD>
<TD> <center>
<B>
<% Response.Write(rsedu("strDate")) %>
</B>
</Center>
<center>
<B> </B> </Center></TD>
<TD width="224">
<center>
<a href= "<% =(rsedu("strPath"))%>"> <font
color="00BFFF"><B>
<% Response.Write(rsedu("strEdudoc")) %></a>
</b></font></a> </center></TD>
<TD width="90"><center>
<B>
<% If rsedu("strRsvp")=y And rsedu("strDistrict")=cha
Then%>
<a
href="mailto:mpelley@c...">RSVP</a>
<%
Else If rsedu("strRsvp")=y And rsedu("strDistrict")=cehha Then%>
<a
href="mailto:mpelley@c...">RSVP</a>
<%
Else If rsedu("strRsvp")=y And rsedu("strDistrict")=pcha Then %>
<a href="mailto:mpelley@c...">RSVP</a>
<%
Else %>
<b>N/A</b>
<%
End If %>
</b> </Center></TD>
<%
rsedu.MoveNext
Loop
%>
</table>
<% rsedu.close
set rsedu=Nothing
contodb.close
set contodb=Nothing
%>
Message #4 by "Roy, Siddarth S" <sroy@b...> on Tue, 16 Jul 2002 11:33:03 -0400
|
|
Try Indenting u r code and closing the if loops inside do loop and
indent them properly too
hope this helps
Sid
-----Original Message-----
From: mpelley@c... [mailto:mpelley@c...]
Sent: Tuesday, July 16, 2002 12:38 PM
To: ASP Databases
Subject: [asp_databases] loop without do error
I am getting the strangest error from an asp script I am working on. I
am attempting to open a simple connection to a db and extract
information
regarding weather or not certain educaitonal opportunities are available
to view and display them in a table.
I have done the exact same code on other pages and it works fine with
the exception of one difference on this page, I am trying to use if then
statements to allow the user to email an rsvp to someone. I am getting a
loop without do error, even though there is definitly a do statement,
only
one do statement to be percise, and nothing overly complicated to
convolute the situation. I am stumped, if there is someone out there who
can help me I would really appreaciate it.
mark
<%
dha=3Drequest.form("StrDistrict")
set contoDb=3DServer.CreateObject("ADODB.Connection")
contoDB.ConnectionTimeout=3D30
contoDB.Open "DSN=3DIntra"
set rsedu=3DServer.CreateObject("ADODB.RecordSet")
strSQL=3D "Select * From tbl_edu where (strDistrict)=3D'" &dha& "'"
set rsedu=3DcontoDB.Execute(strSql)
%>
=09
<TABLE BORDER=3D0>
<tr>
<TD bgcolor=3D"#0099ff" width=3D"71"> <div
align=3D"center"><b><u>DHA</u></b></div></TD>
<TD width=3D"59" bgcolor=3D"#0099ff"> <div
align=3D"center"><b><u>Date</u></b></div>
<div align=3D"center"><b></b></div></TD>
<TD bgcolor=3D"#0099ff" width=3D"224"> <center>
<b><u>Sponsor/Session</u></b></center></TD>
<TD bgcolor=3D"#0099ff" width=3D"90"> <div
align=3D"center"><b><u>RSVP</u></b></div></TD>
</TR>
<TR>
<TH COLSPAN=3D4> </TH>
</TR>
<font class=3D"normal"></font>
<%
Do While Not rsedu.EOF
%>
<TR>
<TD width=3D"71"> <center>
<B>
<% Response.Write(rsedu("strDistrict")) %>
</B> </Center></TD>
<TD> <center>
<B>
<% Response.Write(rsedu("strDate")) %>
</B>
</Center>
<center>
<B> </B> </Center></TD>
<TD width=3D"224">
<center>
<a href=3D "<% =3D(rsedu("strPath"))%>"> <font
color=3D"00BFFF"><B>
<% Response.Write(rsedu("strEdudoc")) %></a>
=09
</b></font></a> </center></TD>
<TD width=3D"90"><center>
<B>
<% If rsedu("strRsvp")=3Dy And
rsedu("strDistrict")=3Dcha
Then%>
<a
href=3D"mailto:mpelley@c...">RSVP</a>
<%
Else If rsedu("strRsvp")=3Dy And rsedu("strDistrict")=3Dcehha Then%>
<a
href=3D"mailto:mpelley@c...">RSVP</a>
<%
Else If rsedu("strRsvp")=3Dy And rsedu("strDistrict")=3Dpcha Then %>
<a href=3D"mailto:mpelley@c...">RSVP</a>
<%
Else %>
=09
<b>N/A</b>
<%
End If %>
</b> </Center></TD>
<%
rsedu.MoveNext
Loop
%>
</table>
<% rsedu.close
set rsedu=3DNothing
contodb.close
set contodb=3DNothing
%>
|
|
 |