If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > paging records

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-21-06, 17:20
alxtech alxtech is offline
Registered User
 
Join Date: Mar 2006
Posts: 3
paging records

i have an application that searches records from a database, sometimes the recors are too many and i want to brake them into individual pages showing a max of 10 records per page. i tried using paging recordset feature from dreamweaver but it does not work well, it repeats records.
Please help me with any code that i can impletemt, here is the connection and query:

Dim Recordset1
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Dim MM_objConn_STRING
set MM_objConn_STRING=server.CreateObject("ADODB.conne ction")
MM_objConn_STRING.open = "Provider=SQLOLEDB.1;DataSource=datatest\INST1;Dat abase=datatest;uid=user_namewd=password;Network Library=DBMSSOCN;"
Recordset1.ActiveConnection = MM_objConn_STRING

Recordset1.Source = "SELECT idmum,namefirst,namelast,namemiddle FROM tbl_test where namelast like 'smith' "

I am displaying results in a table.

Thank you.
Reply With Quote
  #2 (permalink)  
Old 09-26-06, 17:07
blmgyossi blmgyossi is offline
Registered User
 
Join Date: May 2006
Location: New York
Posts: 15
what's your DBMS (e.g. SQL Server, MySQL, etc.),

If you use MySQL, at the end of your SELECT statement you can put in LIMIT x, y
where x is the starting point and y is the number of records you want. SO what you can do is keep track of where the user is i.e. viewing 11 - 20, x = 11, if they click next, x = 21. (I assume y will always be 10).

Last edited by blmgyossi; 09-26-06 at 17:42.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On