Results 1 to 5 of 5

Thread: Paged Searching

  1. #1
    Join Date
    Aug 2005
    Posts
    27

    Question Unanswered: Paged Searching

    Hi everyone!
    I would like to ask for help on this.....

    I have a database searching page in asp (paged_search.asp) that can search by (a) name or (b) gender.

    When you search for example "A%", it will return Amanda and the rest of names which have A as the beginning letter for their names. They are in hyperlink. When you click that link (for instance the name of "Amanda"), you can view then the details of "Amanda"...like her GENDER, AGE, etc.

    After displaying Amanda, here comes my dilemma....
    When I try to search for another name or just even typed '%', it will not return anything.
    Not unless if you go to another page and click again to paged_search.asp will I be able to search any name again.... bummer!!!

    I think it has something to do with my include file "adovbs.inc"
    I am still a newbie in asp and don't kinda understand much with the stuff inside adovbs.inc.

    I cannot download zip/doc files so in case you wana c my code...please see attached .TXT file.

    Hope you can help me!!

    Thanks!
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    I had a quick look and I couldn't see anything obviously wrong (but I was in a hurry so).

    One thing I would say though is that you should be including the file "adovbs.inc" at the start of the page, not part way down.

    As it is you are trying to use the constants before they are actually defined.

  3. #3
    Join Date
    Aug 2005
    Posts
    27
    Hiya Rokslide! =)

    Done!! But still hasn't solved my prob.. =(

    Why can't it run ok when I search again??...but if I don't use paging (w/c by the way has no include file of adovbs.inc)....my code works fine...

    See attached for the no recordpaging code...
    Attached Files Attached Files

  4. #4
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    I don't know if this would be causing the problem but...

    You don't seem to be setting an initial value for numofobs,... so when you get to
    Code:
    <%do while not rs.eof and numofobs<rs.pagesize%>
    you are seeing if null < rs.pagesize

    This would be likely to cause problems.... although I am once again not sure that fixing this will fix the problem you are seeing.

  5. #5
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    another thought that is more likely to solve the problem...

    you have this line
    Code:
    if u_id <> "" then %>
    so if u_id has no value you will not write out any lines.

    u_id is set at the start of the page by doing a request.querystring

    is the method you are using to start you second page including the u_id in the url???

Posting Permissions

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