473,399 Members | 3,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

request.querystring, all values if empty?

Kim
How do I get all walues if my querystring is empty?
If I have a table with let's say 10 rows/records, (ID 1-10). I then have a
recordset with request.querystring("id") and get the record having the id
thats shown in the address bar ("..com?id=4" would get the record with the
id 4). How do I get all records if the querystring is empty ("..com")

I have:

<%
Dim rs_yadayada
rs_yadayada= "1"
If (request.querystring("id") <"") Then
rs_yadayada= request.querystring("id")
End If
%>

and in the sql: ...WHERE id = " + Replace(rs_yadayada__id, "'", "''")
-but doesn't get me anything if the querystring is empty. Tried changing the
"1" to wildcards, arrays (1-10),.. but nope, I'm too dumb to figure this
out.
May 23 '07 #1
2 7377
Kim wrote:
How do I get all walues if my querystring is empty?
If I have a table with let's say 10 rows/records, (ID 1-10). I then
have a recordset with request.querystring("id") and get the record
having the id thats shown in the address bar ("..com?id=4" would get
the record with the id 4). How do I get all records if the
querystring is empty ("..com")
I have:

<%
Dim rs_yadayada
rs_yadayada= "1"
If (request.querystring("id") <"") Then
rs_yadayada= request.querystring("id")
End If
%>

and in the sql: ...WHERE id = " + Replace(rs_yadayada__id, "'", "''")
-but doesn't get me anything if the querystring is empty. Tried
changing the "1" to wildcards, arrays (1-10),.. but nope, I'm too
dumb to figure this out.
If you want to retrieve all the records in a table, what sql statement would
you write? Write it down. Got it? Now, in your code, check to see if the
quertystring variable is empty. If it is empty, use the sql statement you
just wrote down instead of building one with a where clause.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
May 23 '07 #2
Kim
If you want to retrieve all the records in a table, what sql statement
would you write? Write it down. Got it? Now, in your code, check to see if
the quertystring variable is empty. If it is empty, use the sql statement
you just wrote down instead of building one with a where clause.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Thanks, got it.
May 23 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Max | last post by:
Hello. This is the first time I've posted to a newsgroup, and I do this because I'm in desperate need of help. I'm working a user management system, and when I activate a user that has registered...
4
by: Steve | last post by:
Hi- I'd like to set values in the QueryString if I detect that a user submits a bad value, say... ?id=333 where there is no id '333', I would like to set it to '0' for example. I tried to use...
4
by: Guoqi Zheng | last post by:
On my application, I need to have different action based on the pass in query string. When the query string is not presented, I try to use If request.querystring("id") ="" THEN ...... This is...
5
by: VB Programmer | last post by:
I have an ASPX page that is used for content. I have a master page which sticks the page in an IFrame. Question: From the content/ASPX page, I can't seem to reference request.querystring. Any...
1
by: C | last post by:
Hi, I have been using VB.Net for the past 2 years and have moved to C# I send a value in the URL to a page. In my called page I do below. int intTest = int.Parse(Request.QueryString);
6
by: Roshawn Dawson | last post by:
Hi, While browsing the web, I've noticed that a lot of websites have values in the url without any file extensions mentioned. Consider this (fake) url: http://www.yourdomain.com/article/1 ...
4
by: Arvan | last post by:
there is 3 links to page default.aspx,and each one has a querystring,like a=1, b=1 ,c=1. problem is how do i ensure the name of querystring! how do?
2
by: Doogie | last post by:
Hi, I'm writing Javascript code to parse out a query string. I want to handle the case where a parameter value may not be sent. So consider a parameter called "State". If the user doesn't pass...
0
by: mcaneaney | last post by:
I have created an array ‘GiftOnDeath(n)’, where n = the number of gifts… Dim GiftOnDeath() ‘do some code and collect the number of gifts ‘NumGiftsOnDeath' Redim GiftOnDeath(NumGiftsOnDeath) ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.