473,549 Members | 2,581 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=Micro soft.Jet.OLEDB. 4.0; Data Source=" &
Server.MapPath( "\data\kwm\kjv. mdb")
Set rs = CreateObject("A DODB.Recordset" )
Set ss = CreateObject("A DODB.Recordset" )
Set ts = CreateObject("A DODB.Recordset" )

rs.Open "select distinct booktitle, book from bibletable order by book ASC",
connStrx, 3, 4
If Not rs.EOF Then
If Request.Form("S ubmit")="GO" Then
bookopt = request.form("b ook")
else
bookopt=""
end if
While Not rs.EOF
If trim(bookopt) = trim(rs("bookti tle")) 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.book title]='" & bookopt & "' order by chapter ASC", connStrx, 3,
4
If Not ss.EOF Then
While Not ss.EOF
chap1=ss("chapt er")
response.write ss("chapter")

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

ts.Open "select * from bibletable where [bibletable.book title]='" &
bookopt & "' and [bibletable.chap ter]=" & 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 1269
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******** ******@TK2MSFTN GP09.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=Micro soft.Jet.OLEDB. 4.0; Data Source=" &
Server.MapPath( "\data\kwm\kjv. mdb")
Set rs = CreateObject("A DODB.Recordset" )
Set ss = CreateObject("A DODB.Recordset" )
Set ts = CreateObject("A DODB.Recordset" )

rs.Open "select distinct booktitle, book from bibletable order by book ASC", connStrx, 3, 4
If Not rs.EOF Then
If Request.Form("S ubmit")="GO" Then
bookopt = request.form("b ook")
else
bookopt=""
end if
While Not rs.EOF
If trim(bookopt) = trim(rs("bookti tle")) 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.book title]='" & bookopt & "' order by chapter ASC", connStrx, 3, 4
If Not ss.EOF Then
While Not ss.EOF
chap1=ss("chapt er")
response.write ss("chapter")

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

ts.Open "select * from bibletable where [bibletable.book title]='" &
bookopt & "' and [bibletable.chap ter]=" & 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("chapt er")
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.book title]='" &
bookopt & "' and [bibletable.chap ter]=" & 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******** ******@TK2MSFTN GP09.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_da rkfalz.com> wrote in message
news:uc******** *****@TK2MSFTNG P10.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******** ******@TK2MSFTN GP09.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=Micro soft.Jet.OLEDB. 4.0; Data Source=" &
Server.MapPath( "\data\kwm\kjv. mdb")
Set rs = CreateObject("A DODB.Recordset" )
Set ss = CreateObject("A DODB.Recordset" )
Set ts = CreateObject("A DODB.Recordset" )

rs.Open "select distinct booktitle, book from bibletable order by book ASC",
connStrx, 3, 4
If Not rs.EOF Then
If Request.Form("S ubmit")="GO" Then
bookopt = request.form("b ook")
else
bookopt=""
end if
While Not rs.EOF
If trim(bookopt) = trim(rs("bookti tle")) 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.book title]='" & bookopt & "' order by chapter ASC",

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

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

ts.Open "select * from bibletable where [bibletable.book title]='" &
bookopt & "' and [bibletable.chap ter]=" & 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******** ********@TK2MSF TNGP11.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("chapt er")
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.book title]='" &
bookopt & "' and [bibletable.chap ter]=" & 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******** ******@TK2MSFTN GP09.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
3242
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 "invisible" copy of the spreadsheet changeable via form POST via COM automation object (via Python) - then after recalculating - present the spreadsheet...
3
2840
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 look like this:
9
4625
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
2446
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 into an access database to manipulate it. In the table I have: FIRSTNAME | LASTNAME | BADGE# | DATE | TIME The problem is that the...
39
2614
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 ("file_name"). I looked at sscanf(), but that didn't seem to do what I wanted. Thanks, Joe
1
3333
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 comprised of a DataGrid may have separate permissions for adding, deleting and updating a news item. Problem Up until now, I have been implementing...
8
1800
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 of the patterns (e.g., Model View Presenter) or strategies for separating UI logic from the underlying business rules and data. As I understand...
14
1216
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 will only be preceeded by an operator if it is a '-', if it is preceded by nothing, '+' is to be assumed. Using re.split, I can generate a list...
14
1546
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 example of how this kind of thing is done when making calls to MySQL? Thank you.
0
7730
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7491
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6055
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5101
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3509
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3491
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1956
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
776
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.