473,498 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Separating results

MRK
I want to add a <p> after 10 results are given
and do this in a loop after every 10 results.
Here is my query and my current results code

How would I modify this to add a <P> after
every 10 results for ts?

<%
Response.Buffer = True
Dim connStrx, rs, ss, ts, book1, verse1, chap1, bookopt
connStrx = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &
Server.MapPath("\data\kwm\kjv.mdb")
Set rs = CreateObject("ADODB.Recordset")
Set ss = CreateObject("ADODB.Recordset")
Set ts = CreateObject("ADODB.Recordset")

rs.Open "select distinct booktitle, book from bibletable order by book ASC",
connStrx, 3, 4
If Not rs.EOF Then
If Request.Form("Submit")="GO" Then
bookopt = request.form("book")
else
bookopt=""
end if
While Not rs.EOF
If trim(bookopt) = trim(rs("booktitle")) then
response.write "<option value='" & rs("booktitle") & "' selected>" &
rs("booktitle") & "</option>"
else
response.write "<option value='" & rs("booktitle") & "'>" &
rs("booktitle") & "</option>"
end if
rs.MoveNext
Wend

ELSE
END IF
rs.close
set rs = nothing

If len(bookopt)>1 Then
ss.Open "select distinct chapter from bibletable where
[bibletable.booktitle]='" & bookopt & "' order by chapter ASC", connStrx, 3,
4
If Not ss.EOF Then
While Not ss.EOF
chap1=ss("chapter")
response.write ss("chapter")

' here is where I want to create a <p> after every 10 results

ts.Open "select * from bibletable where [bibletable.booktitle]='" &
bookopt & "' and [bibletable.chapter]=" & chap1 & " order by verse ASC",
connStrx, 3, 4
If Not ts.EOF Then
While Not ts.EOF
response.write " <font color=red>" & ts("verse") & "</font> " &
ts("textdata") & " "
ts.MoveNext
Wend
ts.close
else
end if
ss.MoveNext
Wend
else
end if
end if
%>
Jul 19 '05 #1
4 1257
outside the loop put in a variable (XX = 0)
At that point in the loop you want the <P> do a:
IF XX >= 10 then
..."<P>"....
XX = 0
ELSE
XX = XX + 1
END IF
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"MRK" <sdkngfksdnf> wrote in message
news:ud**************@TK2MSFTNGP09.phx.gbl...
I want to add a <p> after 10 results are given
and do this in a loop after every 10 results.
Here is my query and my current results code

How would I modify this to add a <P> after
every 10 results for ts?

<%
Response.Buffer = True
Dim connStrx, rs, ss, ts, book1, verse1, chap1, bookopt
connStrx = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &
Server.MapPath("\data\kwm\kjv.mdb")
Set rs = CreateObject("ADODB.Recordset")
Set ss = CreateObject("ADODB.Recordset")
Set ts = CreateObject("ADODB.Recordset")

rs.Open "select distinct booktitle, book from bibletable order by book ASC", connStrx, 3, 4
If Not rs.EOF Then
If Request.Form("Submit")="GO" Then
bookopt = request.form("book")
else
bookopt=""
end if
While Not rs.EOF
If trim(bookopt) = trim(rs("booktitle")) then
response.write "<option value='" & rs("booktitle") & "' selected>" &
rs("booktitle") & "</option>"
else
response.write "<option value='" & rs("booktitle") & "'>" &
rs("booktitle") & "</option>"
end if
rs.MoveNext
Wend

ELSE
END IF
rs.close
set rs = nothing

If len(bookopt)>1 Then
ss.Open "select distinct chapter from bibletable where
[bibletable.booktitle]='" & bookopt & "' order by chapter ASC", connStrx, 3, 4
If Not ss.EOF Then
While Not ss.EOF
chap1=ss("chapter")
response.write ss("chapter")

' here is where I want to create a <p> after every 10 results

ts.Open "select * from bibletable where [bibletable.booktitle]='" &
bookopt & "' and [bibletable.chapter]=" & chap1 & " order by verse ASC",
connStrx, 3, 4
If Not ts.EOF Then
While Not ts.EOF
response.write " <font color=red>" & ts("verse") & "</font> " &
ts("textdata") & " "
ts.MoveNext
Wend
ts.close
else
end if
ss.MoveNext
Wend
else
end if
end if
%>

Jul 19 '05 #2
The simple way is to put in a counter like so (added code in uppercase):

DIM I
I = 1
RESPONSE.WRITE "<p>"
While Not ss.EOF
chap1=ss("chapter")
response.write ss("chapter")

' here is where I want to create a <p> after every 10 results
IF I = 10 THEN
RESPONSE.WRITE "</p>" & vbCrLf & "<p>"
I = 0
END IF

ts.Open "select * from bibletable where [bibletable.booktitle]='" &
bookopt & "' and [bibletable.chapter]=" & chap1 & " order by verse ASC",
connStrx, 3, 4
If Not ts.EOF Then
While Not ts.EOF
response.write " <font color=red>" & ts("verse") & "</font> " &
ts("textdata") & " "
ts.MoveNext
Wend
ts.close
else
end if
ss.MoveNext

I = I + 1

Wend
Ray at work

"MRK" <sdkngfksdnf> wrote in message
news:ud**************@TK2MSFTNGP09.phx.gbl...
I want to add a <p> after 10 results are given
and do this in a loop after every 10 results.
Here is my query and my current results code

How would I modify this to add a <P> after
every 10 results for ts?


Jul 19 '05 #3
MRK
DOH !!!
so simple. thanks
I should apply my VFP experience more in ASP
I do simple loops like this all the time in VFP

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:uc*************@TK2MSFTNGP10.phx.gbl...
outside the loop put in a variable (XX = 0)
At that point in the loop you want the <P> do a:
IF XX >= 10 then
..."<P>"....
XX = 0
ELSE
XX = XX + 1
END IF
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"MRK" <sdkngfksdnf> wrote in message
news:ud**************@TK2MSFTNGP09.phx.gbl...
I want to add a <p> after 10 results are given
and do this in a loop after every 10 results.
Here is my query and my current results code

How would I modify this to add a <P> after
every 10 results for ts?

<%
Response.Buffer = True
Dim connStrx, rs, ss, ts, book1, verse1, chap1, bookopt
connStrx = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &
Server.MapPath("\data\kwm\kjv.mdb")
Set rs = CreateObject("ADODB.Recordset")
Set ss = CreateObject("ADODB.Recordset")
Set ts = CreateObject("ADODB.Recordset")

rs.Open "select distinct booktitle, book from bibletable order by book ASC",
connStrx, 3, 4
If Not rs.EOF Then
If Request.Form("Submit")="GO" Then
bookopt = request.form("book")
else
bookopt=""
end if
While Not rs.EOF
If trim(bookopt) = trim(rs("booktitle")) then
response.write "<option value='" & rs("booktitle") & "' selected>" & rs("booktitle") & "</option>"
else
response.write "<option value='" & rs("booktitle") & "'>" &
rs("booktitle") & "</option>"
end if
rs.MoveNext
Wend

ELSE
END IF
rs.close
set rs = nothing

If len(bookopt)>1 Then
ss.Open "select distinct chapter from bibletable where
[bibletable.booktitle]='" & bookopt & "' order by chapter ASC",

connStrx, 3,
4
If Not ss.EOF Then
While Not ss.EOF
chap1=ss("chapter")
response.write ss("chapter")

' here is where I want to create a <p> after every 10 results

ts.Open "select * from bibletable where [bibletable.booktitle]='" &
bookopt & "' and [bibletable.chapter]=" & chap1 & " order by verse ASC",
connStrx, 3, 4
If Not ts.EOF Then
While Not ts.EOF
response.write " <font color=red>" & ts("verse") & "</font> " &
ts("textdata") & " "
ts.MoveNext
Wend
ts.close
else
end if
ss.MoveNext
Wend
else
end if
end if
%>


Jul 19 '05 #4
MRK
Thanks Ray.
as I told Curt. I do simple loops like
this in VFP and did not think I could do
it in ASP..

I did have to rearrange the loop though
as I wanted the <p> within the ts results
10 was also to high and had use 7

Thanks again for the assist

<%
If Not ts.EOF Then
TX=1
While Not ts.EOF
IF TX = 7 THEN
RESPONSE.WRITE "</p>" & vbCrLf & "<p>"
TX = 0
END IF
response.write " <font color=red>" & ts("verse") & "</font> " &
ts("textdata") & " "
ts.MoveNext
TX = TX + 1
Wend
ts.close
else
end if
%>
"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:%2****************@TK2MSFTNGP11.phx.gbl...
The simple way is to put in a counter like so (added code in uppercase):

DIM I
I = 1
RESPONSE.WRITE "<p>"
While Not ss.EOF
chap1=ss("chapter")
response.write ss("chapter")

' here is where I want to create a <p> after every 10 results
IF I = 10 THEN
RESPONSE.WRITE "</p>" & vbCrLf & "<p>"
I = 0
END IF

ts.Open "select * from bibletable where [bibletable.booktitle]='" &
bookopt & "' and [bibletable.chapter]=" & chap1 & " order by verse ASC",
connStrx, 3, 4
If Not ts.EOF Then
While Not ts.EOF
response.write " <font color=red>" & ts("verse") & "</font> " &
ts("textdata") & " "
ts.MoveNext
Wend
ts.close
else
end if
ss.MoveNext

I = I + 1

Wend
Ray at work

"MRK" <sdkngfksdnf> wrote in message
news:ud**************@TK2MSFTNGP09.phx.gbl...
I want to add a <p> after 10 results are given
and do this in a loop after every 10 results.
Here is my query and my current results code

How would I modify this to add a <P> after
every 10 results for ts?

Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3228
by: Patrick | last post by:
I am investigating a web-based app wherein I wanted to provide html form frontends to an Excel spreadsheet sitting on a MS Windows server; with each authenticated HTTP user having thier own...
3
2833
by: Kai Grossjohann | last post by:
Consider this frame definition: <html> <frameset rows="50%,50%"> <frame frameborder="0" src="one.html"> <frame frameborder="0" src="two.html"> </frameset> </html> And the two frames both...
9
4614
by: Anon Email | last post by:
Hi people, I'm learning about header files in C++. The following is code from Bartosz Milewski: // Code const int maxStack = 16; class IStack
2
2440
by: Riegn Man | last post by:
I have a problem with access and our time clocks. We have time clocks that put out a .log file with the badge swipes for everybody. There is one .log file for each day. I am pulling that data...
39
2610
by: Joe Laughlin | last post by:
If I have a character array with "/some/file/directory/file_name", are there any functions / libraries that I could use to separate the directory ("some/file/directory") from the file name...
1
3323
by: Earl Teigrob | last post by:
Background: When I create a ASP.NET control (User or custom), it often requires security to be set for certain functionality with the control. For example, a news release user control that is...
8
1795
by: Jeff S | last post by:
Please note that this question is NOT about any particular pattern - but about the general objective of separating out presentation logic from everything else. I'm trying to "get a grip" on some...
14
1203
by: Rob Cowie | last post by:
I'm having a bit of trouble with this so any help would be gratefully recieved... After splitting up a url I have a string of the form 'tag1+tag2+tag3-tag4', or '-tag1-tag2' etc. The first tag...
14
1531
by: Gilles Ganault | last post by:
Hi One of the ways to raise performance for PHP apps is to separate static contents from dynamic contents, so that the former can be compiled once into cache. Can someone give me a simple...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6887
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5462
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4590
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
291
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.