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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database data layout in a table 1

Status
Not open for further replies.

Jeremy74

IS-IT--Management
Nov 21, 2001
56
GB
Hi

I have a table with three rows and three colums. What I want is the three rows and Colums to be filled with the same database Colum (different entry).

Example

[recordset1.pic][recordset1.pic][recordset1.pic]
[recordset1.pic][recordset1.pic][recordset1.pic]
[recordset1.pic][recordset1.pic][recordset1.pic]

I can get the all the recordsets going down or accross the way using the repeat region command, but can't get it to populate all 9 cells.

Am I being thick? What's the easy way to do this.

Cheers

Jeremy
 
"Am I being thick? What's the easy way to do this"

Only by expecting some other program to write code that you need.

You need a nested FOR..NEXT loops to go around the recordset and cells, Write the cell tags and display the RS field, then move to the next record on each iteration.

something like;
for i = 1 to int(rs.recordcount/3)
response.write &quot;<tr>&quot;
for cellLoop = 1 to 3
response.write &quot;<td>&quot;
response.write rs.fields(&quot;field&quot;)
response.write &quot;</td>&quot;
if not rs.eof then
rs.movenext
next
else
response.write &quot;<td>&nbsp;</td>
next
end if
response.write &quot;</tr>&quot; & vbCRlf
next

this should write a 3 column table on the page with the rows determined by the number of records.

btw. above code not tested just thinking at the keyboard.




Chris.

Indifference will be the downfall of mankind, but who cares?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top