Author |
Topic  |
tribaliztic
Senior Member
   
Sweden
1532 Posts |
Posted - 24 August 2007 : 02:45:50
|
I need to add paging to a page I'm doing. I got a link with example code from Zuel yesterday but can't really get a grip on how to add it to my code. I need to have a new page after every 20 hits. Can anyone help me with this?
The code is here: http://www.gotlandrace.se/tabort/kommande_info.txt
|
/Tribaliztic - www.gotlandrace.se -
|
|
tribaliztic
Senior Member
   
Sweden
1532 Posts |
Posted - 26 August 2007 : 16:27:39
|
no paging-experts out there? =) The code in the link above is the page I need to add paging to, I've tried myself but I'm stuck...
|
/Tribaliztic - www.gotlandrace.se -
|
 |
|
MarcelG
Retired Support Moderator
    
Netherlands
2625 Posts |
|
tribaliztic
Senior Member
   
Sweden
1532 Posts |
Posted - 28 August 2007 : 02:14:48
|
Thanks Marcel, I've had a look at topic.asp already but can't really make any sense out of it. Can you point me in the right direction regarding what lines I should look at?
|
/Tribaliztic - www.gotlandrace.se -
|
 |
|
tribaliztic
Senior Member
   
Sweden
1532 Posts |
Posted - 28 August 2007 : 06:27:10
|
Ok, so I got the testpage from that tutorial working but I have NO idea how to insert the existing code into this... The code opens a table and then display it onto the page with paging. But how do I make it understand that it's data from a datalayer (or whatever it's called =))? Now I just do this: "Collection = DataLayer.GetFutureArticleList()" and then use the data in that... I'm new to both datalayers and paging so it's a bad match...
|
/Tribaliztic - www.gotlandrace.se -
|
 |
|
MarcelG
Retired Support Moderator
    
Netherlands
2625 Posts |
Posted - 29 August 2007 : 03:44:38
|
ehm....sorry, without spending a lot of time on it (which I don't have, seeing my work piled up during my holiday), I have no idea either. Sorry.... |
portfolio - linkshrinker - oxle - twitter |
Edited by - MarcelG on 29 August 2007 03:45:11 |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
|
tribaliztic
Senior Member
   
Sweden
1532 Posts |
Posted - 29 August 2007 : 04:23:51
|
Do I just replace the line "SQL = "SELECT productID, productName FROM products"" with my datalayer-stuff? It's this part I don't understand, how do I get the paging-code to read my datalayer? =)
|
/Tribaliztic - www.gotlandrace.se -
|
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
Posted - 29 August 2007 : 04:52:40
|
Oh, that's the issue... you're using a data layer yourself...
Well the SQL needs to be your own SQL. Now, on how to change your data layer, that's different issue altogether. I guess you will need a method to retrieve a given page from a recordset, but I'm just wild guessing, cause I really don't know it. |
Snitz 3.4 Readme | Like the support? Support Snitz too |
 |
|
tribaliztic
Senior Member
   
Sweden
1532 Posts |
Posted - 29 August 2007 : 06:11:46
|
Sorry if I'm confusing you, I'm pretty confused myself atm =)
I have high hopes that Zuel finds the time to help me since he helped me understand datalayers, but he's a buzy man I'm afraid. Anyone else know how to do this?
|
/Tribaliztic - www.gotlandrace.se -
|
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
Posted - 29 August 2007 : 06:29:25
|
A data layer is just a way of organizing code, so that the DB access code is concentrated there, instead of being spread through all the application pages. The Snitz .net version uses that approach. There is nothing much to it, conceptually, but you need to know the implementation details.
I would guess that adding paging to it may be a bit work, but as I said before, I really don't know your data layer. |
Snitz 3.4 Readme | Like the support? Support Snitz too |
 |
|
tribaliztic
Senior Member
   
Sweden
1532 Posts |
Posted - 29 August 2007 : 06:34:01
|
This is the function:
Public Function GetArticleList() VerifyConnection() m_strSQL = "SELECT AUKTION_ID, A_STATUS, A_RUBRIK, A_TEXT, PAGE_HITS FROM AUKTION WHERE AUKTION_ID= " & ID & "" Call m_RecordSet.Open(m_strSQL, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText) Select Case (m_RecordSet.RecordCount - 1 < 0) Case True: GetArticleList = Empty Case Else: GetArticleList = m_RecordSet.GetRows() End Select Exit Function End Function
Should I add the paging into that code or the other way around? =)
|
/Tribaliztic - www.gotlandrace.se -
|
 |
|
Zuel
Average Member
  
USA
540 Posts |
Posted - 29 August 2007 : 09:40:37
|
quote: Originally posted by tribaliztic
This is the function:
Public Function GetArticleList() VerifyConnection() m_strSQL = "SELECT AUKTION_ID, A_STATUS, A_RUBRIK, A_TEXT, PAGE_HITS FROM AUKTION WHERE AUKTION_ID= " & ID & "" Call m_RecordSet.Open(m_strSQL, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText) Select Case (m_RecordSet.RecordCount - 1 < 0) Case True: GetArticleList = Empty Case Else: GetArticleList = m_RecordSet.GetRows() End Select Exit Function End Function
Should I add the paging into that code or the other way around? =)
Find me online today. Also put the file in our sharing folder. |
My Completed Mods: News Mod | Zuel's Avatar Add-on In Development: World of Warcraft Member Roster | [C# Based Forum]
Note - I may take a few days to recieve your email. Hotmail filters all new emails as junk. Would be best to post all questions, concerns in a forum topic to catch my immediate attention. This way others can assist and also correct any similar mistakes.
MSN / E-Mail: ucyimDa_Ruler@Hotmail.com
Personal Bookmarks: How to work a DBS File
|
 |
|
MaD2ko0l
Senior Member
   
United Kingdom
1053 Posts |
Posted - 15 September 2007 : 14:03:36
|
hey tribaliztic
did u get it all sorted in the end?? |
© 1999-2010 MaD2ko0l |
 |
|
tribaliztic
Senior Member
   
Sweden
1532 Posts |
Posted - 16 September 2007 : 02:15:47
|
Zuel is helping me, we seem to miss eachother online all the time though =)
|
/Tribaliztic - www.gotlandrace.se -
|
 |
|
tribaliztic
Senior Member
   
Sweden
1532 Posts |
Posted - 25 September 2007 : 08:29:52
|
The info is displayed, but not divided into pages... Any hints?
This is the datalayer code:
Public Function GetItemList2() VerifyConnection() m_RecordSet.PageSize = 5 m_RecordSet.CacheSize = 5 m_RecordSet.CursorLocation = adUseClient m_strSQL = "SELECT ITEM_ID, I_AUKTIONID, I_RUBRIK, I_TEXT, I_UTROP, I_****PRIS, PAGE_HITS FROM item WHERE I_AUKTIONID= " & ID & " ORDER BY I_RUBRIK" Call m_RecordSet.Open(m_strSQL, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText)
Select Case(Len(Request.QueryString(page)) = 0) Case True: m_RecordSet.AbsolutePage = 1 Case Else: Select Case (CLong(Request.QueryString(page)) <= m_RecordSet.PageCount) Case True: m_RecordSet.AbsolutePage = CLng(Request.QueryString(page)) Case Else: m_RecordSet.AbsolutePage = 1 End Select End Select
Select Case (m_RecordSet.RecordCount - 1 < 0) Case True: GetItemList2 = Empty Case Else: GetItemList2 = m_RecordSet.GetRows() End Select Exit Function End Function
Can anyone see why it's not being divided into pages? Do you need more info?
|
/Tribaliztic - www.gotlandrace.se -
|
 |
|
Topic  |
|