Print Page | Close Window

Expected Loop Error

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=5061
Printed Date: 30 March 2026 at 11:01pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Expected Loop Error
Posted By: groq
Subject: Expected Loop Error
Date Posted: 15 August 2003 at 3:17pm

I'm getting the following error in internet  explorer:

######################################
Error Type:
Microsoft VBScript compilation (0x800A03FB)
Expected 'Loop'
######################################

Here's my code: Can anyone please point out the problem in my code.

######################################
<%
dim accessdb, Conn, dbPath, cn, rs, sql

accessdb="staffdata.mdb"


dbPath = "C:\Staffdata.mdb"
  Set Conn = Server.CreateObject("ADODB.Connection")
  Conn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & dbPath

Set rs = Server.CreateObject("ADODB.Recordset")


sql = "SELECT LName, FName, Title, Photograph FROM tblstaff WHERE EStatus = 'Active';"

rs.Open sql, Conn
%>
<center>
<img align="center" src="pix/board01.gif">
</center>
<table BORDER="1" BORDERCOLOR="#558AF8" align="center" width="640">
<tr>
<%
rs.movefirst
do while not rs.eof
%>
<td align="center"><img src=../Upload/<%= rs("Photograph") %> align=left width="70" height="70"><b>
<%= rs("LName") %>
</b <b>
<%= rs("FName") %>
</b>
<br>
<%= rs("Title") %>
</td>
</tr>

<%
rs.movenext
%>
</table>

</body>
</html>

<%
rs.close
set rs=nothing
%> 
###########################################



-------------
GROQ



Replies:
Posted By: KCWebMonkey
Date Posted: 15 August 2003 at 3:36pm

<%
rs.movenext
Loop
%>



Posted By: groq
Date Posted: 15 August 2003 at 3:47pm

Thank you KCWebMonkey!  The 'Loop' function worked.  Thank you!

GROQ



-------------
GROQ



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net