|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
May 24th, 2005, 10:02 AM
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Dissapearing VAR
I am loosing a Var that I need to show my database orderby
First i Dim the Var
Dim orderSTR
Then pick the order in a drop down
<option>Builder</option>
<option>Last Shed</option>
<option>Year Wdrn</option>
</select>
<input type="submit" value="Submit" />
</form>
Then I have a case statement to get my Var and set my Orderby clause
strOrderBy = trim(Request.QueryString("order"))
Select Case strOrderBy
Case "Builder"
strOrderBy = "builder"
orderSTR = "Builder"
Case "Last Shed"
strOrderBy = "last_shed"
orderSTR = "Last Shed"
Case "Year Wdrn"
strOrderBy = "yy_wdn"
orderSTR = "Year Withdrawn"
End Select
I then use the Var orderSTR to show the orderby
Searched for Class <%= strSearch %> sorted by <%=orderSTR%> Found <%= irecordcount %> from <%= record_size %> Records.
This all works fine on the first page, BUT on the subsequent pages the var orderSTR just dissappears although strOrderBy and everything else works
I cannot see where i could be loosing it, if its there on the first page it made it thru, so why after a loop does it dissapear
If this is not enough code I will post the whole script but it is pretty large
Thanks Topshed
|
May 24th, 2005, 11:45 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Looks like you are missing to pass that as a querystring for each page. That should be where you would be missing. With the posted information, I can't think of anything else.
May be for the first page, when you submit from the form it works fine, but from there on you should be passing the needed information with the querystring to get that work. That is how it should be.
Let us know if that is where you go wrong.
_________________________
- Vijay G
Strive for Perfection
|
May 25th, 2005, 12:43 AM
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Your right of course I do pass the stuff in a querystring and somehow forgot to add this one when I added the Variable
I use
<a href="lnclass.asp?page=<%= I %>&search=<% =Server.URLEncode(strSearch) %>&order=<%= Server.URLEncode(strOrderBy) %>"><%= I %></a>
I am struggling with how to include it however I assume something like
&orderSTR=<% =Server.URLEncode(orderSTR) %>
but that fell over (sigh)
any assistance would be great
Topshed
|
May 25th, 2005, 12:49 AM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Post here, what you see in the address bar as URL, when you click on that link that shows up for the <a href...> you posted in your previous post.
_________________________
- Vijay G
Strive for Perfection
|
May 25th, 2005, 09:17 AM
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
June 3rd, 2005, 01:34 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
I checked both your urls, it looks like in the first you are referring it as ORDER=LAST+SHED
But in the second, you are referring it as orderSTR=LAST+SHED
Thats what you are missing here. You got to keep it same in both places to get that work. Not sure if you are referring to the other one with in your code for other than 1st page.
_________________________
- Vijay G
Strive for Perfection
|
|
|