Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RecSet problems 1

Status
Not open for further replies.

Sajtz

IS-IT--Management
Apr 23, 2002
75
EU
Hi!

I'm having a database with usernames, which I need to present on a html page. I figured this could be done in a table with the RecSet method, but I can't seem to get it right.

My problem is that I want the usernames to show up in three different columns in a table. It is easy to get it right when I jus use one column like this:

<table><tr><td>
<%Do Until RecSet.EOF %>
<%=RecSet(&quot;username&quot;) %><br>
<%RecSet.MoveNext
Loop
RecSet.Close %>
</td></tr></table>

But how can I make the usernames from the database to show up in different columns in the table??

This is how I want it to look like:
<table>
<tr>
<td>username1<br>username2<br>username3</td>
<td>username4<br>username5<br>username6</td>
<td>username7<br>username8<br>username9</td>
</tr>
</table>

 

Do while not objRS.EOF
strOut = strOut & &quot;<tr><td>&quot; & objRS(&quot;username&quot;) & &quot;</td>&quot;
objRS.movenext
if not objRS.EOF then
strOut = strOut & &quot;<td>&quot; & objRS(&quot;username&quot;) & &quot;</td>&quot;
objrs.movenext
if not objRS.EOF then
strOut = strOut & &quot;<td>&quot; & objRS(&quot;username&quot;) & &quot;</td>&quot;
objrs.movenext
end if
end if
strOut = strOut & &quot;</tr>&quot;
LOOP -----------------------------------------------------------------
&quot;C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg.&quot;
- Bjarne Stroustrup

mikewolf@tst-us.com
 
Thanx!

Your code followed by a simple response.write &quot;&quot;&strOut solved my problem! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top