Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

How can I pass empty value in URL Parameter

New Here ,
Jul 06, 2006 Jul 06, 2006
Hi,
I am passing different URL parameters to one page, to filter the recordset on that page. How can I pass an empty value in the URL parameter so that the recordset in unfiltered?
The URL parameter is based on one field of the database: ContentType. So, the link would be to
default.asp?ContentType=Event
and then all records that have the ContentType field in the DB as Event are displayed. Is it possible to use this system to pass an empty parameter so that all records are displayed?
Thanks
Ian
TOPICS
Server side applications
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 06, 2006 Jul 06, 2006
?ContentType=All

<% if (ContentType == "All")
Build recordset w/o filtering

ASP is rusty, but those are the basics.
"iandobie" <webforumsuser@macromedia.com> wrote in message
news:e8im80$q7m$1@forums.macromedia.com...
> Hi,
> I am passing different URL parameters to one page, to filter the recordset
> on
> that page. How can I pass an empty value in the URL parameter so that the
> recordset in unfiltered?
> The URL parameter is based on one field of the database: ContentType. So,
> the
> link would be to
> default.asp?ContentType=Event
> and then all records that have the ContentType field in the DB as Event
> are
> displayed. Is it possible to use this system to pass an empty parameter so
> that
> all records are displayed?
> Thanks
> Ian
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 06, 2006 Jul 06, 2006
Hi Crash,
thanks for that - but how/where would I specify the 'if URL Parameter 'ContentType' is passed as 'All' then build unfiltered recordset' statement? Is this something i can do through the dreaweaver interface, or would I put the code in by hand at some specific point?
The code is HERE
Thanks
Ian
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 06, 2006 Jul 06, 2006
Which recordset are you sorting?

If it's this one:

Dim
Recordset1__MMColParam
Recordset1__MMColParam = "%"
If
(Request.QueryString("ContentType") <> "") Then
Recordset1__MMColParam =
Request.QueryString("ContentType")
End If

It actually looks like it's keeping the value at %, which I *thought* was a
wildcard in SQL, so should be bringing *anything* in....

I"m runnign to lunch, when I get back I'll check on that unless another
poster can confirm that % is wildcard (thus saying all categories should be
returned). Have you done the recordset w/o any other parameters to ensure
this wildcard will work on your content type?


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 06, 2006 Jul 06, 2006
When I made the recordset in the advanced recordset dialogue, I set the default value of the URL parameter to '%' in the hope that if no value was passed then all records would be returned. However, it doesn't do it.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 06, 2006 Jul 06, 2006
Only if you're comparing against text, not numbers, and only if you use LIKE
as your comparison, not = or any other test.

"iandobie" <webforumsuser@macromedia.com> wrote in message
news:e8jms6$84q$1@forums.macromedia.com...
> When I made the recordset in the advanced recordset dialogue, I set the
> default
> value of the URL parameter to '%' in the hope that if no value was passed
> then
> all records would be returned. However, it doesn't do it.
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 06, 2006 Jul 06, 2006
So...do you have numbers or text listed? What's contained within ContType?


"Lionstone" <HIDElionstone@HIDEhushmail.com> wrote in message
news:e8jpe0$baf$1@forums.macromedia.com...
> Only if you're comparing against text, not numbers, and only if you use
> LIKE as your comparison, not = or any other test.
>
> "iandobie" <webforumsuser@macromedia.com> wrote in message
> news:e8jms6$84q$1@forums.macromedia.com...
>> When I made the recordset in the advanced recordset dialogue, I set the
>> default
>> value of the URL parameter to '%' in the hope that if no value was passed
>> then
>> all records would be returned. However, it doesn't do it.
>>
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 06, 2006 Jul 06, 2006
The values that are contained within 'ContentType' are text: Event, News, Feature or Portfolio. I can filter a recordset by any one of these using a URL parameter, but can't display all records.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 07, 2006 Jul 07, 2006
Does that mean i can define it in the SQL statement by adding another parameter, something like
WHERE MBD_ContentType = MMColParam OR MBD_ContentType LIKE '%'
(or something like that - I'm only just getting to grips with SQL)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 10, 2006 Jul 10, 2006
LATEST
I think so, have you tested this? I"m alone at the office and it's been a
little hectic here.


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines