Re: Using Database Results Wizard for dropdown

From: Rich Palarea (nospam_at_none.com)
Date: 06/23/04


Date: Wed, 23 Jun 2004 19:28:59 -0400

Eve - that works great!

I'm hoping, now, to find an answer to this dilemma:

(repost from above):

A followup question (sorry about re-using the original post):
The distinct function works well. I don't want to limit the chance of
returning a record, so I'd like to offer the user the chance to select all
records, in addition to being able to select the preferences they want
(i.e.: no preference). To give you a better idea of how the sql is
structured (MS Access db with .asp):

User can choose to find a group by three fields: GroupMix, MeetingDay,
MeetingLocation from the table Smallgroups. All are dropdown fields in a
form. GroupMix and MeetingLocation are populated by a SELECT statement to
the Smallgroups table. MeetingDay is pre-populated with days of the week.

It is easy to get "no records found" with this setup, because of the limited
number of records in the table at present. I would like the user to be
allowed the choices of "no preference" inside of the three drop down fields.

Present SQL for the form (showing just the dropdown portion for GroupMix;
there is a similar select for MeetingLocation further down in my page):

<% end if %>
<%
fp_sQry="SELECT Distinct Smallgroups.GroupMix FROM Smallgroups ORDER BY
GroupMix ASC"
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="GFCData"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="GroupMix"
fp_sMenuValue="GroupMix"
fp_sColTypes="&OrgID=3&Name=202&MeetingDay=202&MeetingLocation=202&GroupMix=
202&MeetingTime=202&ChildrenAllowed=202&Status=202&ContactIndLabel=202&Conta
ctHomePhone=202&ContactIndvEmail=202&"
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>

Present SQL for the results page:
<% end if %>
<%
fp_sQry="SELECT * FROM Smallgroups WHERE (status = 'open' AND MeetingDay =
'::MeetingDay::' AND GroupMix = '::GroupMix::' AND MeetingLocation =
'::MeetingLocation::')"
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="GFCData"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&OrgID=3&Name=202&MeetingDay=202&MeetingLocation=202&GroupMix=
202&MeetingTime=202&ChildrenAllowed=202&Status=202&ContactIndLabel=202&Conta
ctHomePhone=202&ContactIndvEmail=202&"
fp_iDisplayCols=11
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>

Present working page: http://smallgroups.gfc.org/IDsite/locator.asp

Thanks!
Rich

"Rich Palarea" <nospam@none.com> wrote in message
news:uS3mi8FWEHA.3024@TK2MSFTNGP09.phx.gbl...
> I'm using the Database Results Wizard to populate a dropdown list in a
form.
> In this case, the field I'm pulling from is a city (text). At present, I'm
> getting every record in the dropdown. I only want the unique records. For
> example, if Los Angeles is listed in 200 records, I don't want 200 choices
> for Los Angeles in the dropdown...only one.
>
> Is there a parameter you can add to the sql of the Database Results Wizard
> or elsewhere in the .asp page that will only return the first value and
skip
> the rest?
>
> Thanks in advance.
> Rich
>
>

"Eve" <anonymous@discussions.microsoft.com> wrote in message
news:2086101c45949$653d3010$a501280a@phx.gbl...
> Rich:
>
> Make sure you choose Custom Query within the Database
> Results Wizard and then type in this SQL statement
> (substitute your table for Department and your field name
> for DepartmentName):
>
> SELECT DISTINCT * FROM Department ORDER BY DepartmentName
> ASC
>
> I hope this helps.
>
> >-----Original Message-----
> >I'm using the Database Results Wizard to populate a
> dropdown list in a form.
> >In this case, the field I'm pulling from is a city
> (text). At present, I'm
> >getting every record in the dropdown. I only want the
> unique records. For
> >example, if Los Angeles is listed in 200 records, I
> don't want 200 choices
> >for Los Angeles in the dropdown...only one.
> >
> >Is there a parameter you can add to the sql of the
> Database Results Wizard
> >or elsewhere in the .asp page that will only return the
> first value and skip
> >the rest?
> >
> >Thanks in advance.
> >Rich
> >
> >
> >.
> >



Relevant Pages

  • Re: Moving databases from SQL 7 to SQL 2000 - More Questions!
    ... Personally I feel using the copy DB wizard is more effort than just a backup ... Passwords Between SQL Servers ... Issues When a Database Is Moved Between SQL Servers ... for SQL Server ...
    (microsoft.public.sqlserver.setup)
  • RE: ODBC Imports of entire Database
    ... When I run the wizard it does not give me the option to copy the entire ... connect to the other database. ... Start the SQL Server Import and Export Wizard ... SSIS package so that we can maintain the SQL base and not have to recreate ...
    (microsoft.public.sqlserver.dts)
  • RE: Trouble with SQL Adapter Metadata Wizard in BizTalk Server 2006
    ... However when I type the SQL Server name ... it works fine and then I can select the default database. ... I'm getting in trouble with SQL Adapter Metadata Wizard in BizTalk 2006. ...
    (microsoft.public.biztalk.general)
  • Problems with sortable tables and DRW
    ... This tutorial uses Frontpage's Database Results Wizard. ... The page is saved as an Active Server Page because FrontPage ... When you specify options, FrontPage writes the SQL ...
    (microsoft.public.frontpage.client)
  • Re: Front Page Inventory search
    ... items that are in the database. ... >called Monitors and values of VGA, SVGA, DVI and you want ... >select one from a dropdown. ... >You can get quite detailed SQL generated from the wizard ...
    (microsoft.public.frontpage.programming)