Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Hotizontal Records Display in ASP.

0 views
Skip to first unread message

iahamed via WebmasterKB.com

unread,
Aug 10, 2008, 3:52:38 AM8/10/08
to
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.

--
Message posted via WebmasterKB.com
http://www.webmasterkb.com/Uwe/Forums.aspx/asp-db/200808/1

Evertjan.

unread,
Aug 10, 2008, 4:21:57 AM8/10/08
to
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.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

pa...@bullschmidt.com

unread,
Sep 15, 2008, 9:07:29 PM9/15/08
to

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

0 new messages