| Author |
Topic Search Topic Options
|
Mikeap
Newbie
Joined: 12 March 2003
Location: United States
Status: Offline
Points: 37
|
Post Options
Thanks(0)
Quote Reply
Posted: 24 August 2003 at 9:19pm |
|
|
 |
Mikeap
Newbie
Joined: 12 March 2003
Location: United States
Status: Offline
Points: 37
|
Post Options
Thanks(0)
Quote Reply
Posted: 24 August 2003 at 9:22pm |
Here is the full recordset code and the GetRow.
<% Dim rsround1__MMColParam rsround1__MMColParam = "1" If (Request("MM_EmptyValue") <> "") Then rsround1__MMColParam = Request("MM_EmptyValue") End If %> <% Dim rsround1__MMColParam2 rsround1__MMColParam2 = "1" If (Request.QueryString("tournid") <> "") Then rsround1__MMColParam2 = Request.QueryString("tournid") End If %>
<% Dim rsround1 Dim rsround1_numRows
Dim arrRound1
Set rsround1 = Server.CreateObject("ADODB.Recordset") rsround1.ActiveConnection = MM_db_data_conn_STRING rsround1.Source = "SELECT TOP 16 * FROM TBL_TOURNAMENTBRACKETS WHERE bracketposition = " + Replace(rsround1__MMColParam, "'", "''") + " AND tournid = " + Replace(rsround1__MMColParam2, "'", "''") + " ORDER BY tournbracketsid ASC" rsround1.CursorType = 0 rsround1.CursorLocation = 2 rsround1.LockType = 1 rsround1.Open()
rsround1_numRows = 0
arrRound1 = rsround1.GetRows %> |
Edited by Mikeap
|
 |
b_bonnett
Mod Builder Group
Joined: 16 April 2003
Location: New Zealand
Status: Offline
Points: 275
|
Post Options
Thanks(0)
Quote Reply
Posted: 24 August 2003 at 9:23pm |
That means the entry in the array you are trying to reference does not exist. The columns go from 0 to 4 (i.e. five entries) and there is one row (0). So you can't reference the (non-existent) second row, which is what you are trying to do, hence the error.
Blair
|
|
|
 |
Mikeap
Newbie
Joined: 12 March 2003
Location: United States
Status: Offline
Points: 37
|
Post Options
Thanks(0)
Quote Reply
Posted: 24 August 2003 at 9:24pm |
Exactly - I know and understand this ... I want to say if the second-sixteen does not exist, display this instead.
How?
|
 |
b_bonnett
Mod Builder Group
Joined: 16 April 2003
Location: New Zealand
Status: Offline
Points: 275
|
Post Options
Thanks(0)
Quote Reply
Posted: 24 August 2003 at 9:31pm |
Try using the following:
If UBound(arrRound1, 2) > 0 Then ...Display Stuff From Array... Else ...Message Saying Whatever... End If |
Basically, if there are two rows, then UBound(arrRound1, 2) will equal one - I've used > 0 so that it will also display if there are more than 2. If there is only one row, then your message saying "No data in the second row", or whatever the message is, will be displayed.
Blair
|
|
|
 |
ljamal
Mod Builder Group
Joined: 16 April 2003
Status: Offline
Points: 888
|
Post Options
Thanks(0)
Quote Reply
Posted: 24 August 2003 at 9:41pm |
|
Use Ubound(arrRound1,2) to determine if the row is available. If Ubound(arrRound1,2) is less than the row you are seeking then you do not have values to display in the row. Remember that the even Ubound begins counting at 0 so an array with one row will have an Upper Bound (UBound) equal to zero (0) not one (1). An array will no rows should produce an error with Ubound, I believe.
|
|
|
 |
Mikeap
Newbie
Joined: 12 March 2003
Location: United States
Status: Offline
Points: 37
|
Post Options
Thanks(0)
Quote Reply
Posted: 24 August 2003 at 9:42pm |
hmm - how do i incorporate this for 16 rows?
if you look at the link on the first page, each gray line will have response.write(arrRound(3,0)) (0-15)
see what im saying?
|
 |
ljamal
Mod Builder Group
Joined: 16 April 2003
Status: Offline
Points: 888
|
Post Options
Thanks(0)
Quote Reply
Posted: 24 August 2003 at 10:03pm |
|
I'm assuming that you have 5 recordsets (one for each round) and each record set should have half the number of records as the previous so use a For loop and mod
For i = 0 to Ubound(arrRound1,0)
Response.Write arrRound1(0,i)
if i mod 2 = 0 then
Response.Write arrRound2(0,CLng(i/2))
end if
if i mod 4 = 0 then
Response.Write arrRound3(0,CLng(i/4))
end if
if i mod 8 = 0 then
Response.Write arrRound4(0,CLng(i/8))
end if
if i mod 16 = 0 then
Response.Write arrRound5(0,CLng(i/16))
end if
Next
|
|
|
 |