What is a "Foreword" to a blog?
Hotizontal Records Display in ASP.
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > ASP web-programming > Hotizontal Records Display in ASP. 16 September 2008 04:07:29

  Recent blog posts: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

Hotizontal Records Display in ASP.

iahamed via WebmasterKB.com 16 September 2008 04:07:29
 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/DisplayRO­wsHorizon/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("I­tem")&"</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=Microsof­t.Jet.OLEDB.4.0; Data Source="& Server.MapPath
("/aspcodes/Display­ROwsHorizon/DisRowHo­rizon.mdb"))


Your Help in this regard will be Highly appreciated.

Thank you.

--
Message posted via WebmasterKB.com
http://www.webmaste­rkb.com/Uwe/Forums.a­spx/asp-db/200808/1

Add comment
Evertjan. 10 August 2008 11:21:57 permanent link ]
 iahamed via WebmasterKB.com wrote on 10 aug 2008 in
microsoft.public.in­etserver.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)
Add comment
iahamed via WebmasterKB.com 11 August 2008 07:31:29 permanent link ]
 Hello Evertjan,

I do not know How to thank you and the Great Forum of WebmasterKB. This is
One Forum that I always visit to get solutions in ASP. Its nice to see the
ASP Lovers here. Thank you So much, SO much for the wonderful Help given in
this Regard.

It was an erroneous error made by me in the DB connection, with your Kind
Generosity Evertjan, I had to make it work with ASP and HTML table that makes
it more Rational. Heres the Code:


<%
Dim connStr
connStr = "Provider=Microsoft­.Jet.OLEDB.4.0; Data Source=" & Server.MapPath
("DisRowHorizon.mdb­")
Dim objRS
Set objRS = Server.CreateObject­("ADODB.Recordset")
objRS.Open "select [Id],[Item] from tblData order by [ID] desc",
connStr, 3, 4
%>
<%
IF Not objRS.EOF THEN %>

<table border="1" width="150" cellspacing="3" id="table1" height="64"
bordercolorlight="#­F5F5F5" style="border-colla­pse: collapse"
bordercolor="#F5F5F­5" cellpadding="3">

<% recCount = 0
While Not objRS.EOF
'DO UNTIL objRS.EOF

IF recCount Mod 3 = 0 THEN
%>
<tr>

<% END IF %>

<td><%=objRS("Item"­)%></td>

<% recCount = recCount + 1

IF recCount Mod 3 = 0 THEN %>

</tr>

<% END IF

objRS.MoveNext
'LOOP
Wend

IF recCount Mod 3 <> 0 THEN %>

</tr>

<% END IF %>


</table>

<%

ELSE
Response.Write "Sorry, there are no records in our database."
END IF

objRS.Close
Set objRS = Nothing

%>


Thank you Once again Evertjan, WIsh you good luck in your career. Web master
KB, thank you for the Lovely Work.

B' Regards.

--
Message posted via WebmasterKB.com
http://www.webmaste­rkb.com/Uwe/Forums.a­spx/asp/200808/1

Add comment
Guest 16 September 2008 04:07:29 permanent link ]
 On Aug 10, 2:52am, "iahamed via WebmasterKB.com" <u42620@uwe> wrote:
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/DisplayRO­wsHorizon/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("I­tem")&"</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=Microsof­t.Jet.OLEDB.4.0; Data Source="& Server.MapPath
("/aspcodes/Display­ROwsHorizon/DisRowHo­rizon.mdb"))
Your Help in this regard will be Highly appreciated.
Thank you.
--

For reference here's a short article I wrote about displaying records
horizontally:

Classic ASP Design Tips - Multiple Records in Each Row
http://www.bullschm­idt.com/devtip-multi­plerecsineachrow.asp­

Best regards,
-Paul
www.Bullschmidt.com­ - Freelance Web and Database Developer
www.Bullschmidt.com­/DevTip.asp - Classic ASP Design Tips
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > ASP web-programming > Hotizontal Records Display in ASP. 16 September 2008 04:07:29

see also:
Delegation syntax? (was: Re: Private…
Object Instantiation (Was: Re…
Re: Perlmasons. Be the first on your…
пройди тесты:
see also:
Reports from jemmy framework
documentum training
why not in frensh?

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .