Forums
This topic is locked
Error with Nested Repeat Regions
Posted 18 Sep 2007 17:18:36
1
has voted
18 Sep 2007 17:18:36 Lloyd Davis posted:
Hi,I've been following a tutorial to setup some nested repeat regions on a test page I set up. I would like to repeat the main recordset and then repeat the second recordset within the main rs using a field in the first as a filter. However I get the following error message from the ASP code I added to the table...
Error Type:
Microsoft JScript compilation (0x800A03EE)
Expected ')'
/datatest.asp, line 44, column 11
While (NOT Recordset2.EOF)
Is there something simple I've missed like the tutorial is in vbscript instead of javascript or something?
Thanks
Lloyd
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/iiGymConectionString.asp" -->
<%
var Recordset1_cmd = Server.CreateObject ("ADODB.Command"
Recordset1_cmd.ActiveConnection = MM_iiGymConectionString_STRING;
Recordset1_cmd.CommandText = "SELECT * FROM dbo.tblClassCategory";
Recordset1_cmd.Prepared = true;
var Recordset1 = Recordset1_cmd.Execute();
var Recordset1_numRows = 0;
%>
<%
var Recordset2_cmd = Server.CreateObject ("ADODB.Command"
Recordset2_cmd.ActiveConnection = MM_iiGymConectionString_STRING;
Recordset2_cmd.CommandText = "SELECT * FROM dbo.tblEquip";
Recordset2_cmd.Prepared = true;
var Recordset2 = Recordset2_cmd.Execute();
var Recordset2_numRows = 0;
%>
<%
var Repeat1__numRows = -1;
var Repeat1__index = 0;
Recordset1_numRows += Repeat1__numRows;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>data test page</title>
</head>
<body>
<% while ((Repeat1__numRows-- != 0) && (!Recordset1.EOF)) { %>
<table width="200" border="0">
<tr>
<td><%=(Recordset1.Fields.Item("category_title_webviewable".Value)%></td>
</tr>
<tr>
<td>
<%
FilterParam = Recordset1.Fields.Item("class_category_id".Value
Recordset2.Filter = "classcategory = " & FilterParam
While (NOT Recordset2.EOF)
%>
<%=(Recordset2.Fields.Item("description".value)%>,
<%
Recordset2.MoveNext()
Wend
%>
</td>
</tr>
</table>
<%
Repeat1__index++;
Recordset1.MoveNext();
}
%>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</body>
</html>
<%
Recordset1.Close();
%>
<%
Recordset2.Close();
%>