Hi all,
I need to display records Horizontally, I do not know for some reason this
code gives me an error, uses an access db.
>> Error type:
Microsoft VBScript compilation (0x800A040E)
'loop' without 'do'
/aspcodes/DisplayROwsHorizon/index.asp, line 26
Loop
I normally use the While Not objRS.EOF and close it with a Wend. Using what
ever way here it clashes with the If Statement Logic.
> index.asp
</html>
<title>Hotizontal Records Display.</title>
<!--#include file="conn.asp"-->
<body>
<%
DIM mySQL, objRS
mySQL = "SELECT * FROM tblData"
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open mySQL, objConn
DIM recCount
IF Not objRS.EOF THEN
Response.Write "<table width='100%'>"
recCount = 0
Do UNTIL objRS.EOF
IF recCount Mod 3 = 0 THEN
IF recCount <> 0 THEN
Response.Write "</tr>"
Response.Write "<tr><td>"&objRS("Item")&"</td>"
ELSE
Response.Write "<td>"&objRS("Item")&"</td>"
END IF
recCount = recCount + 1
objRS.MoveNext
Loop
Response.Write"</tr></table>"
ELSE
Response.Write "Sorry, there are no records in our database."
END IF
%>
</body>
</html>
------------------------------------------------------------------------
> Con.asp
'Dim objRS Name is in Index so cannot redefine
'Dim objRS
set objRS= Server.CreateObject("ADODB.Connection")
objRS.Open ("Provider=Microsoft.Jet.OLEDB.4.0; Data Source="& Server.MapPath
("/aspcodes/DisplayROwsHorizon/DisRowHorizon.mdb"))
Your Help in this regard will be Highly appreciated.
Thank you.
Evertjan. - 10 Aug 2008 09:21 GMT
iahamed via WebmasterKB.com wrote on 10 aug 2008 in
microsoft.public.inetserver.asp.db:
> I need to display records Horizontally, I do not know for some reason
> this code gives me an error, uses an access db.
Please do not multipost, already answered elsewhere.

Signature
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
paul@bullschmidt.com - 16 Sep 2008 02:07 GMT
> Hi all,
>
[quoted text clipped - 72 lines]
> --
> Message posted via WebmasterKB.comhttp://www.webmasterkb.com/Uwe/Forums.aspx/asp-db/200808/1
For reference here's a short article I wrote about displaying records
horizontally:
Classic ASP Design Tips - Multiple Records in Each Row
http://www.bullschmidt.com/devtip-multiplerecsineachrow.asp
Best regards,
-Paul
www.Bullschmidt.com - Freelance Web and Database Developer
www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips