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 > Paged Searching

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-19-05, 01:08
seraphicmortal seraphicmortal is offline
Registered User
 
Join Date: Aug 2005
Posts: 27
Question 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
File Type: txt mycodes.txt (11.5 KB, 42 views)
Reply With Quote
  #2 (permalink)  
Old 10-19-05, 19:43
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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.
Reply With Quote
  #3 (permalink)  
Old 10-19-05, 19:56
seraphicmortal seraphicmortal is offline
Registered User
 
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
File Type: txt no record paging.txt (2.2 KB, 39 views)
Reply With Quote
  #4 (permalink)  
Old 10-19-05, 20:26
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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.
Reply With Quote
  #5 (permalink)  
Old 10-19-05, 20:43
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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???
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