Reply
Help with displaying information from a database
Old 11-17-2006, 04:17 AM Help with displaying information from a database
oohmygod831's Avatar
Average Talker

Posts: 29
i have a photographic website which is primarily asp with access db. I can display the records from the db in either a single row or a single column but thats it, i would like to display records in a row and then when that row is complete to start a new row until the stipulated number of records has been displayed.
oohmygod831 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 11-17-2006, 11:11 AM Re: Help with displaying information from a database
etech355's Avatar
Average Talker

Posts: 28
Location: Maryland
Try this.......

<table>
<%
Set Cnn = Server.CreateObject("ADODB.Connection")
Cnn.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=C:\mydatabase.mdb"

sql="select * from products"
set rs=Cnn.execute(sql)

howmanyfields=rs.fields.count - 1

%>
<tr>
<%
for i = 0 to howmanyfields
%>
<th><%=rs.fields(i).name%></th>
<%
next
%>
</tr>
<%

do while not rs.eof
%>
<tr>
<%
for i = 0 to howmanyfields%>
<td><%=rs.fields(i).value%></td>
<% next%>
</tr>

<%

rs.movenext
loop

rs.Close
set rs=nothing

%>
</table>
__________________
Eric - ASP, Javascript, T-SQL, PHP
GameCheatsLive - Rate Games - Play Now
FarmTape - Country Style News - Humor
etech355 is offline
Reply With Quote
View Public Profile Visit etech355's homepage!
 
Reply     « Reply to Help with displaying information from a database
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12428 seconds with 12 queries