Forums
This topic is locked
Nested Repeat regions
Posted 16 Jan 2003 14:40:24
1
has voted
16 Jan 2003 14:40:24 Doug Banville posted:
I'm using a nested repeat region after reading the great article on this site www.dmxzone.net/ShowDetail.asp?NewsId=394. But I want to filter the nested region by more than one recordset. Right now my code looks like FilterParam = Master.Fields.Item("ProductID".Value
Child.Filter = "ProductID = '" & FilterParam & "'"
While (NOT Child.EOF)
I would like the nested recordset to filter by ProductID and LineID. How would I add the extra code?
Thanks
Replies
Replied 16 Jan 2003 22:28:13
16 Jan 2003 22:28:13 Dave Blohm replied:
I haven't read the article, but this is how I do nested repeat regions where the child region is based on multiple criteria...
<%
Dim rs1
Dim rs2
Set rs1 = Server.CreateObject("ADODB.Recordset"
rs1.ActiveConnection = MM_CONN_STRING
rs1.Source = "SELECT * FROM dbo.SectionsMain"
rs1.CursorType = 0
rs1.CursorLocation = 2
rs1.LockType = 1
rs1.Open()
While Not rs1.EOF
Set rs2 = Server.CreateObject("ADODB.Recordset"
rs2.ActiveConnection = MM_CONN_STRING
rs2.Source = "SELECT * FROM dbo.DownloadCatalog WHERE YourColumn1 = N'" & rs1.Fields.Item("ying".Value & "' AND YourColumn2 = N'" & rs1.Fields.Item("yang".Value & "'"
rs2.CursorType = 0
rs2.CursorLocation = 2
rs2.LockType = 1
rs2.Open()
rs1.MoveNext
Wend
%>
Hope this helps...
Doc
Rangewalk Digital Studios
<%
Dim rs1
Dim rs2
Set rs1 = Server.CreateObject("ADODB.Recordset"
rs1.ActiveConnection = MM_CONN_STRING
rs1.Source = "SELECT * FROM dbo.SectionsMain"
rs1.CursorType = 0
rs1.CursorLocation = 2
rs1.LockType = 1
rs1.Open()
While Not rs1.EOF
Set rs2 = Server.CreateObject("ADODB.Recordset"
rs2.ActiveConnection = MM_CONN_STRING
rs2.Source = "SELECT * FROM dbo.DownloadCatalog WHERE YourColumn1 = N'" & rs1.Fields.Item("ying".Value & "' AND YourColumn2 = N'" & rs1.Fields.Item("yang".Value & "'"
rs2.CursorType = 0
rs2.CursorLocation = 2
rs2.LockType = 1
rs2.Open()
rs1.MoveNext
Wend
%>
Hope this helps...
Doc
Rangewalk Digital Studios
Replied 03 Apr 2009 23:00:06
03 Apr 2009 23:00:06 April Trew replied:
I want to do a nested repeating region like above but with 1 master and then a Child than another Child with URL variables for each. Can I use the code above with another child?
Example:
Candy (master)
chocolate (child 1)
M&M's (child 2)
snickers (child 2)
fruity (child 1)
Skittles (child 2)
Starburst (child 2)
Example:
Candy (master)
chocolate (child 1)
M&M's (child 2)
snickers (child 2)
fruity (child 1)
Skittles (child 2)
Starburst (child 2)