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 > how to filter out unwanted selection in rs paging link

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-17-04, 14:32
gilgalbiblewhee gilgalbiblewhee is offline
Registered User
 
Join Date: Jul 2004
Posts: 494
how to filter out unwanted selection in rs paging link

Ok. Since The recordset paging didn't work as I had posted in my previous thread, I decided to look for a new sample code on paging. Thank God it worked. But I'm trying to figure out what to write in the page links:

Code:
  response.write "<a href=""paging1.asp?page="&i&"&Keyword="
& Keyword &"
&Keywordb="& Keywordb &"
&Keywordc="& Keywordc &"
&spoke=" & spoke & "
&book_spoke=Book_Spoke
&chapter_spoke=Chapter_Spoke
&verse_spoke=Verse_Spoke
&text_data=yes
&optAction=on"">"&i&"</a> "
These:
Code:
&book_spoke=Book_Spoke
&chapter_spoke=Chapter_Spoke
&verse_spoke=Verse_Spoke
are used by checkboxes as well as:
Code:
&text_data=yes
But I'm not concerned about
Code:
&text_data=yes
since I need it for every search.

But is there a way to filter out the selection like the previous checkbox selections if they are not selected?
Reply With Quote
  #2 (permalink)  
Old 10-17-04, 19:09
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
if I understand you right then yes.... instead of doing this...
Code:
response.write "<a href=""paging1.asp?page="&i&"&Keyword="
& Keyword &"
&Keywordb="& Keywordb &"
&Keywordc="& Keywordc &"
&spoke=" & spoke & "
&book_spoke=Book_Spoke
&chapter_spoke=Chapter_Spoke
&verse_spoke=Verse_Spoke
&text_data=yes
&optAction=on"">"&i&"</a> "
do something more like this...
Code:
pagingurl = "<a href=""paging1.asp?page="&i&"&Keyword="
& Keyword &"
&Keywordb="& Keywordb &"
&Keywordc="& Keywordc

if spoke<> "" then pagingurl = pagingurl & "&spoke=" & spoke

if Book_Spoke <> "" then pagingurl = pagingurl & "&book_spoke=" & Book_Spoke
if Chapter_Spoke<> "" then pagingurl = pagingurl & "&chapter_spoke=" & Chapter_Spoke
if Verse_Spoke<> "" then pagingurl = pagingurl & "&verse_spoke=" & Verse_Spoke

pagingurl = pagingurl & "&text_data=yes&optAction=on"">"&i&"</a> "
response.write pagingurl
Reply With Quote
  #3 (permalink)  
Old 10-17-04, 20:43
gilgalbiblewhee gilgalbiblewhee is offline
Registered User
 
Join Date: Jul 2004
Posts: 494
please correct me...

where do I go wrong?

Code:
               response.write "<a href=""" & Request.ServerVariables("SCRIPT_NAMES") & "?page="&i&"" &_
"&Keyword="& Keyword &_
"&Keywordb="& Keywordb &_
"&Keywordc="& Keywordc &_
"&text_data=yes" &_"
if spoke<> "" then pagingurl = pagingurl" & "&spoke=" & spoke &_
"if Book_Spoke <> "" then pagingurl = pagingurl" & "&book_spoke=" & Book_Spoke &_
"if Chapter_Spoke<> "" then pagingurl = pagingurl" & "&chapter_spoke=" & Chapter_Spoke &_
"if Verse_Spoke<> "" then pagingurl = pagingurl" & "&verse_spoke=" & Verse_Spoke &_
"&optAction=on"">"&i&"</a> "
Reply With Quote
  #4 (permalink)  
Old 10-17-04, 20:48
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
*sigh* you went wrong by trying to do it other then the way I suggested.

You are trying to write out the URL before you have determine what the url should be. This is quite simply a very very very bad idea.

The code I posted creates a variable and builds it (in the same way you build your sql string) and then only once it is complete does it get used.

What you are trying to do (and I'm guessing here because it's a mess) is write out the url and build it at the same time and that will not work.

Build first, then write it.
Reply With Quote
  #5 (permalink)  
Old 10-17-04, 20:55
gilgalbiblewhee gilgalbiblewhee is offline
Registered User
 
Join Date: Jul 2004
Posts: 494
ok I see what you did. I missed the "pagingurl ="
Reply With Quote
  #6 (permalink)  
Old 10-17-04, 21:13
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
let me know how you get on.
Reply With Quote
  #7 (permalink)  
Old 10-17-04, 21:30
gilgalbiblewhee gilgalbiblewhee is offline
Registered User
 
Join Date: Jul 2004
Posts: 494
what do you think?
Quote:
Microsoft VBScript compilation error '800a0401'

Expected end of statement

/wheelofgod/kjvresp4.asp, line 261

pagingurl = "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?page="&i&" & "&Keyword="& Keyword &"&Keywordb="& Keywordb &"&Keywordc="& Keywordc & if spoke<> "" then pagingurl = pagingurl & "&spoke=" & spoke & if Book_Spoke <> "" then pagingurl = pagingurl & "&book_spoke=" & Book_Spoke & if Chapter_Spoke<> "" then pagingurl = pagingurl & "&chapter_spoke=" & Chapter_Spoke & if Verse_Spoke<> "" then pagingurl = pagingurl & "&verse_spoke=" & Verse_Spoke & pagingurl = pagingurl & "&text_data=yes" & "&optAction=on""">"&i&"</a> "
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^
Reply With Quote
  #8 (permalink)  
Old 10-17-04, 21:32
gilgalbiblewhee gilgalbiblewhee is offline
Registered User
 
Join Date: Jul 2004
Posts: 494
the arrow is under the 2nd " of "&text_data=yes"
Reply With Quote
  #9 (permalink)  
Old 10-17-04, 21:51
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
you're going to drive me crazy gil...

copy and paste this
Code:
pagingurl = "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?page="&i&" & "&Keyword="& Keyword &"&Keywordb="& Keywordb &"&Keywordc="& Keywordc

if spoke<> "" then pagingurl = pagingurl & "&spoke=" & spoke

if Book_Spoke <> "" then pagingurl = pagingurl & "&book_spoke=" & Book_Spoke

if Chapter_Spoke<> "" then pagingurl = pagingurl & "&chapter_spoke=" & Chapter_Spoke

if Verse_Spoke<> "" then pagingurl = pagingurl & "&verse_spoke=" & Verse_Spoke 

pagingurl = pagingurl & "&text_data=yes" & "&optAction=on""">"&i&"</a> "
Reply With Quote
  #10 (permalink)  
Old 10-17-04, 21:56
gilgalbiblewhee gilgalbiblewhee is offline
Registered User
 
Join Date: Jul 2004
Posts: 494
Updating the paging:
Code:
pagingurl = "<a href=""" & 
Request.ServerVariables("SCRIPT_NAME") & 

"?page="&i&" & 

"&Keyword="& Keyword &

"&Keywordb="& Keywordb &

"&Keywordc="& Keywordc & if spoke<> "" then pagingurl = pagingurl & 

"&spoke=" & spoke & 

if Book_Spoke <> "" then pagingurl = pagingurl &
"&book_spoke=" & Book_Spoke & 

if Chapter_Spoke<> "" then pagingurl = pagingurl & "&chapter_spoke=" & Chapter_Spoke & 

if Verse_Spoke<> "" then pagingurl = pagingurl & "&verse_spoke=" & Verse_Spoke & 

pagingurl = pagingurl & 
text_data=yes&optAction=on"">"&i&"</a> "

response.write pagingurl
shows no errors but says "false".
Reply With Quote
  #11 (permalink)  
Old 10-17-04, 22:07
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
dude, what are you doing to this stuff when you copy and paste??

There are extra &'s being added to the code and that is what is cauing your problems. Also you are spliting lines all over the place. Not a good thing generally.
Reply With Quote
  #12 (permalink)  
Old 10-17-04, 22:23
gilgalbiblewhee gilgalbiblewhee is offline
Registered User
 
Join Date: Jul 2004
Posts: 494
I just noticed your previous posting. I used what you wrote and got :
Quote:
Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/wheelofgod/kjvresp4.asp, line 265

pagingurl = "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?page="&i&" & "&Keyword="& Keyword &"&Keywordb="& Keywordb &"&Keywordc="& Keywordc
-------------------------------------------------------------------------------------------------------------------------------------------------------^
With the arrow under the space that follows this: &"&Keywordc="& Keywordc
Reply With Quote
  #13 (permalink)  
Old 10-17-04, 22:26
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
opps, I'll take the blame for that one, the line should be...
Code:
pagingurl = "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?page=" &i& "&Keyword="& Keyword &"&Keywordb="& Keywordb &"&Keywordc="& Keywordc
Reply With Quote
  #14 (permalink)  
Old 10-17-04, 22:32
gilgalbiblewhee gilgalbiblewhee is offline
Registered User
 
Join Date: Jul 2004
Posts: 494
No problem rokslide sometimes I don't realize when someone has posted until after I post again.

Quote:
Microsoft VBScript compilation error '800a03ea'

Syntax error

/wheelofgod/kjvresp4.asp, line 275

pagingurl = pagingurl & "&text_data=yes" & "&optAction=on""">"&i&"</a> "
-------------------------------------------------------------------^
The arrow is on /
Reply With Quote
  #15 (permalink)  
Old 10-17-04, 22:35
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
try this...
Code:
pagingurl = pagingurl & "&text_data=yes&optAction=on""">" & i & "</a> "
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