"Bob Barrows [MVP]" wrote:
Quote:
Old Pedant wrote:
Quote:
sports = Trim( Request("sports") ) ' do not need to say
Request.QueryString
>
Perhaps not, but I would suggest you do so.
I'm surprised a pedant would advise someone to be less that precise! :-)
LOL! But it *IS* precise...if you know what you are doing.
http://msdn.microsoft.com/en-us/libr...48(VS.85).aspx
Since QueryString is searched first, then
Request("foo")
is equivalent to
Request.QueryString("foo")
with the proviso that the latter actually exists.
Now, pedantically, if for some reason the querystring value does not exist
then the search process will indeed try to find that name in all the other
collections. But unless your code has created a "sports" key/value pair in
Request.Form (that is, via POST) or Cookies, that's not an issue.
Anyway, the reason I tended to use just Request was simple: During
development and debug, I'd use METHOD=GET in my <FORM>s so I could see in the
URL what I was passing. Then, once it was working and debugged, I'd change
to METHOD=POST but wouldn't have to change my VBS code.
A hack, but I think a reasonable one.
Anyway, I'll bet in this case there's no reason for him to know how many
were selected and/or separate them. I'll bet that if he constructed the SQL
efficiently he'd just need to do something such as
sql = " ... WHERE sport IN ('" & Replace(Request("sports"),", ","','")
& "') "
or similar.