Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


MS Database Record On ASP

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,2952
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> MS Database Record On ASP
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 MS Database Record On ASP - 5/11/2005 12:42:03 AM   
  jedaibym

 

Posts: 2
Score: 0
Joined: 5/6/2005
From: Saudi Arabia
Status: offline
I have huge MS Database that stored in my server, and I have ASP displaying the data in the website, and I just succeed connecting MS Database to ASP. But I do not know how to display just 20 records on each page in the website and go to next 20 records... Will you please help me?

Example (Next 1 2 3 4 5 6)
[V]
 
 
Post #: 1
 
 Re: MS Database Record On ASP - 5/11/2005 7:04:34 AM   
  T1TAN23

 

Posts: 11
Score: 0
Joined: 5/11/2005
From: USA
Status: offline
you could try this...

Pass a querystring to the page displaying the records to let you know where to start from the make s sub routine to display the records

Sub displayRecords (rs,Position)
Dim Count
rs.Move Position
Do While NOT rs.EOF AND Count < 21
Response.Write rs("fieldName")
Count = Count + 1
rs.MoveNext()
Loop
End Sub

Then at the bottom of the page where you create you navigation have the page link back to itself but pass a querystring like so

<a href="mypagfe.asp?Position=1">1</a><a href="mypage.asp?Position=20">2</a><a href="mypage.asp"Postion="40">3</a> and so on

You can return the count of the rs to detemine how many page links to create and even create another su to spit out the pages needed

Sub displayPageNavigation(mypage.asp,RecordsPerPage, rs)
Dim Count
Dim lcv
Count = rs.Count / RecordsPerPage
Response.write "<a href=""mypage.asp?Position=1">1</a>"
lcv = 2
Do While lcv < count
Response.write "<a href=""mypage.asp?Position=" lcv * RecordsPerPage & """>lcv</a>"
lcv = lcv + 1
Loop
end Sub

Not sure if all that is going to work but it should at least get you started.

(in reply to jedaibym)
 
 
Post #: 2
 
 Re: MS Database Record On ASP - 5/22/2005 8:18:07 PM   
  jedaibym

 

Posts: 2
Score: 0
Joined: 5/6/2005
From: Saudi Arabia
Status: offline
I try what you suggest but, it disply just one record..not 20 record

(in reply to jedaibym)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> MS Database Record On ASP Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts