Retrieving previous record having filtered values

Results 1 to 2 of 2

Thread: Retrieving previous record having filtered values

  1. #1
    Join Date
    Dec 1969

    Default Retrieving previous record having filtered values

    Hi guys, im having problems retrieving previous records for a detail page. I have a page: <BR><BR>http://dinha/my_detail.asp?uid=70<BR><BR>and i want to show the previous record. I cant use subtraction in order to get the previous record since some of them doesnt fit the filter i made. i get "Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record" error.<BR><BR>sql2 = "SELECT * FROM template WHERE uid BETWEEN "& bawas &" AND shownwhere = &#039;regular&#039; AND activestatus = true ORDER BY uid asc;"<BR><BR>can somebody help me on this? even a sample code will be very much appreciated. thanks!

  2. #2
    Join Date
    Dec 1969

    Default It depends on what you're...

    ...trying to do exactly. You could store all retrieved IDs in a session variable or something and simply pick the previous ID from that. This would work fine if you didn&#039;t have a humungus amount of IDs, since session variables take up space in the server&#039;s memory, and every session will take their chunk of memory.<BR><BR>Alternatively, you could run the whole query every time you need to find the previous ID, but that would probably slow everything down quite a lot, so for the moment I think my previous suggestion might be the better one.<BR><BR>Maybe somebody else here has other ideas?<BR><BR>Oliver.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts