Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



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

Posts: 29
Trades: 0
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
 
 
Register now for full access!
Old 11-17-2006, 12:11 PM Re: Help with displaying information from a database
etech355's Avatar
Average Talker

Posts: 29
Location: Maryland
Trades: 0
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

Please login or register to view this content. Registration is FREE
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 Search this Thread
Search this Thread:

Advanced Search

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

BB 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.24561 seconds with 12 queries