|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
I'm new at ASP and I'm trying to get my search results page to divide up the results so there won't be a lot listed on just one page. This is the only thing I can't figure out. I've tried samples of other code with no luck. Here is my code:
Code:
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Dim cnn
Dim str
Dim search
Dim rs
Dim SQL
search = request.form("bgg")
Set cnn = CreateObject("ADODB.Connection")
str = "Provider=Microsoft.Jet.OLEDB.4.0;"
str = str & "Data Source=C:\Inetpub\wwwroot\test\test.mdb"
cnn.ConnectionString = str
cnn.Open
SQL = "Select * From Price where Header Like '%" & search & "%' order by Page"
Set rs = CreateObject("ADODB.Recordset")
rs.ActiveConnection = cnn
rs.Open SQL
(I took out the tables so the code wouldn't be that long on this post)
rs.MoveNext
Wend
Response.write str
Response.write "<TR><TD> </TD><TD> </TD><TD> </TD><TD><center><img src=Pictures\WesServerLogo.gif></center></TD></TR>"
Response.write "</TABLE></FONT>"
cnn.close
</SCRIPT>
Thanks |
|
#2
|
|||
|
|||
|
I would love to do all the work for you but It would cost money!
Instead why don't you try doing a websearch at http://www.google.com for "asp recordset paging" or any other search engine and you will find plenty of examples. find one which uses rs.AbsolutePage - Specifies in which page the current record resides rs.pagesize - The number of records that constitute one page in the Recordset rs.pagecount - The number of pages of data the Recordset object contains to start on a particular page after openning the rs just go rs.AbsolutePage = request("page")
__________________
-- ngibsonau |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Help: Separating search results; 1|2|3| and so on |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|