16 May 12 12:31
I have a SQL table that contains documents and a table that contains users. I have another table that allows you to link more than one user to a document.
I have a query that then returns a list of documents with the users
Now there is only one document with a DocID of 1 but the join returns two separate rows because there are two people linked to the document.
I then want to display a table that looks like this:
1 Jack, Jane
My recordset is stored in an array so far I have tried this:
For i=0 To UBOUND(DocArray, 2)
Response.Write("<td>" & DocArray(0, i) & "</td>")
Do While DocArray(0, i)=CurrentDocID
Response.Write(DocArray(1, i) & ", ")
The problem I have is that when the name "Jane" is displayed it moves onto the next row in the array by adding 1 to the array and the condition is no longer met so it exits the loop however because it's in a For i=0 To.... Loop, 1 gets added to i again and so the next rows is skipped.
I've been looking at this problem all day and have got to the stage where I can't see the wood for the trees so I would be very greatful for any help.
Thanks very much