VB error Expected 'Wend'

R

Raphael Gluck

Hi
I've been trying to hand code my pages, after failing in a WSYWYG editor and
giving up.
I'm almost done with the page checking, it's just i'm having a Wend error


Microsoft VBScript compilation error '800a03fa'

Expected 'Wend'

/listing.asp, line 269

on my page, www.tripak.me.uk/listing.asp

I've attached the code at www.tripak.me.uk/listing.txt



I believe that Originally when i used the WSYWYG I created two seperate
recordsets, and the two endings were

<%
rsListing.Close()
Set rsListing = Nothing
%>
<%
rsTextspec.Close()
Set rsTextspec = Nothing
%>

Now i tried deleting the rsTextspec one but i still get an error with the
rsListing one, which is the only recordset i have left.

Am i supposed to delete this? and close it up ealier? (line 210) and how?

I hope somone can help me.

Raphael
 
B

Bob Barrows

These are the most aggravating problems. It could be anything from: you
forgot to put a Wend in there, to: you've got an extra "end if" in your
loop, to: you used Next or Loop instead of Wend. Proper formatting of your
code (indenting, etc.) can help you find these issues.

On another note: While...Wend has been deprecated and may not be supported
in a future version of vbscript. You should switch to using Do Until ...
Loop or Do ... Loop Until.

HTH,
Bob Barrows
 
T

Tom B

You have a WHILE (start of a loop) without a WEND(end of a loop)
<%
if blnHasTextSpec = true then
While ((Repeat1__numRows <> 0) AND (NOT rsListing.EOF))
%>
<tr><td><a href="sublisting.asp?Item_ID=<%=rsListing("Item_ID") %>"> <%
rsListing("Text_Spec")%> </a> </td>
<% if rsListing("lrg_img") > "" then %>
<td><% =rsListing("lrg_img") %> </td>
<% end if %>
<% if rsListing("Item_ID") > "" then %>
<td colspan="2"><% rsListing("Item_ID") %> </td>
<% end if %>
<% if rsListing("Specific_imagesm") > "" then %>
<td colspan="2"><% rsListing("Specific_imagesm") %> </td>
<%WEND 'ADD THIS%>
<% end if %>
 
R

Raphael Gluck

Thanks for that
Just a little question,
I paste the following line in

<%WEND 'ADD THIS%>

I tried that and i'm still getting an error
Expected statement

/listing.asp, line 181

WEND 'ADD THIS
I'm obviously supposed to insert something, but what?I'm not sure what wends
are, and how to close themExcuse my IgnoranceRaphael
 
T

Tom B

Remove that line I told you to add, I took a look, and that's not where it
should be.

Put it back in further down

I STRONGLY recommend you get rid of dreamweaver until you know what's going
on. This code is a nightmare to try and decipher.


if blnHasTextSpec = true then
While ((Repeat1__numRows <> 0) AND (NOT rsListing.EOF))
%>
<tr><td><a href="sublisting.asp?Item_ID=<%=rsListing("Item_ID") %>"> <%
rsListing("Text_Spec")%> </a> </td>
<% if rsListing("lrg_img") > "" then %>
<td><% =rsListing("lrg_img") %> </td>
<% end if %>
<% if rsListing("Item_ID") > "" then %>
<td colspan="2"><% rsListing("Item_ID") %> </td>
<% end if %>
<% if rsListing("Specific_imagesm") > "" then %>
<td colspan="2"><% rsListing("Specific_imagesm") %> </td>

<% end if %>

</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsListing.MoveNext()
Wend
else
While ((Repeat1__numRows <> 0) AND (NOT rsListing.EOF))
%>
<tr>
<% if rsListing("Inventory_ID") > "" then %>
<td><% rsListing("Inventory_ID") %> </td>
<% end if %>
<% if rslisting("product_name") > "" then %>
<td><% rsListing("Product_Name") %></td>
<% end if %>
<% if rsListing("DescrMetric") > "" then %>
<td><% rsListing("DescrMetric") %></td>
<% end if %>
<% if rsListing("Color") > "" then %>
<td><% rsListing("Color") %></td>
<% end if %>
<% if rsListing("grades") > "" then %>
<td><% rsListing("Grades") %></td>
<% end if %>
<% if rsListing("words") > "" then %>
<td><% rsListing("words") %></td>
<% end if %>


</tr>
<% rsListing.MoveNext 'ADD THIS%>
<%WEND 'ADD THIS%>
</table>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top