Assign RECORD SOURCE to variable

T

TV12 Webmaster

I have one DATABASE with several RECORD SOURCES:

NEWS2006
NEWS2007
NEWS2008

This is the SQL statement from DRW:

fp_sQry="SELECT county FROM NEWS2006"


Is there a way to assign a variable to the record source, maybe even a
Session varible so the user can select the record source and I can pass that
variable over several pages.

fp_sQry="SELECT county FROM Session ("recordsource")" <--- I know this
doesn't work but it's the idea.

Thanks,
Erik Hardtle
 
T

Thomas A. Rowe

You should be able to do this as long as you are handcoding.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
T

TV12 Webmaster

I'm using Frontpage, it keeps overwriting any changes I make to the fp_sQry
statement. Anyway around this.
 
S

Stefan B Rusynko

But in order for the DBRW to recognize session variables the OP may need to make the tweak at
http://home.att.net/~codelibrary/FrontPage/tweaks.htm#DRW Script Modifications

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| In Code View, make your change to the SQL in the gray colored code, and save
| your change while you're still in Code View. The change will be made to the
| maroon colored code when you save.
|
| --
|
| ~ Kathleen Anderson
| Microsoft MVP - FrontPage
| Spider Web Woman Designs
| web: http://www.spiderwebwoman.com/resources/
| FrontPage Support: http://www.frontpagemvps.com/
|
|
|
|
| | > I'm using Frontpage, it keeps overwriting any changes I make to the
| > fp_sQry statement. Anyway around this.
| >
| >
| > | >> You should be able to do this as long as you are handcoding.
| >>
| >> --
| >> ==============================================
| >> Thomas A. Rowe (Microsoft MVP - FrontPage)
| >> ==============================================
| >> If you feel your current issue is a results of installing
| >> a Service Pack or security update, please contact
| >> Microsoft Product Support Services:
| >> http://support.microsoft.com
| >> If the problem can be shown to have been caused by a
| >> security update, then there is usually no charge for the call.
| >> ==============================================
| >>
| >> | >>>I have one DATABASE with several RECORD SOURCES:
| >>>
| >>> NEWS2006
| >>> NEWS2007
| >>> NEWS2008
| >>>
| >>> This is the SQL statement from DRW:
| >>>
| >>> fp_sQry="SELECT county FROM NEWS2006"
| >>>
| >>>
| >>> Is there a way to assign a variable to the record source, maybe even a
| >>> Session varible so the user can select the record source and I can pass
| >>> that variable over several pages.
| >>>
| >>> fp_sQry="SELECT county FROM Session ("recordsource")" <--- I know
| >>> this doesn't work but it's the idea.
| >>>
| >>> Thanks,
| >>> Erik Hardtle
| >>>
| >>
| >>
| >
| >
|
|
 
T

TV12 Webmaster

I tried putting it in the grey code... it wouldn't format the red code
properly. So I used the spooky diet (www.outfront.net) and removed the
proper grey text which then allowed me to put in the proper sql statment.

Above my html DRW page I added this:
<%
Session("recordsource")= request ("recordsource")
%>

This requests the variable from the form and applies it to a session
variable.

Here is my SQL query statement.

SELECT * FROM "& Session("recordsource") &" WHERE (COUNTY = '::COUNTY::' OR
HEADLINE LIKE '%::keyword::%' OR TEASE LIKE '%::keyword::%' OR STORY LIKE
'%::keyword::%') ORDER BY SDATE DESC

Thanks for the help.

Stefan B Rusynko said:
But in order for the DBRW to recognize session variables the OP may need
to make the tweak at
http://home.att.net/~codelibrary/FrontPage/tweaks.htm#DRW Script Modifications

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


message | In Code View, make your change to the SQL in the gray colored code, and
save
| your change while you're still in Code View. The change will be made to
the
| maroon colored code when you save.
|
| --
|
| ~ Kathleen Anderson
| Microsoft MVP - FrontPage
| Spider Web Woman Designs
| web: http://www.spiderwebwoman.com/resources/
| FrontPage Support: http://www.frontpagemvps.com/
|
|
|
|
| | > I'm using Frontpage, it keeps overwriting any changes I make to the
| > fp_sQry statement. Anyway around this.
| >
| >
| > | >> You should be able to do this as long as you are handcoding.
| >>
| >> --
| >> ==============================================
| >> Thomas A. Rowe (Microsoft MVP - FrontPage)
| >> ==============================================
| >> If you feel your current issue is a results of installing
| >> a Service Pack or security update, please contact
| >> Microsoft Product Support Services:
| >> http://support.microsoft.com
| >> If the problem can be shown to have been caused by a
| >> security update, then there is usually no charge for the call.
| >> ==============================================
| >>
| >> | >>>I have one DATABASE with several RECORD SOURCES:
| >>>
| >>> NEWS2006
| >>> NEWS2007
| >>> NEWS2008
| >>>
| >>> This is the SQL statement from DRW:
| >>>
| >>> fp_sQry="SELECT county FROM NEWS2006"
| >>>
| >>>
| >>> Is there a way to assign a variable to the record source, maybe even
a
| >>> Session varible so the user can select the record source and I can
pass
| >>> that variable over several pages.
| >>>
| >>> fp_sQry="SELECT county FROM Session ("recordsource")" <--- I
know
| >>> this doesn't work but it's the idea.
| >>>
| >>> Thanks,
| >>> Erik Hardtle
| >>>
| >>
| >>
| >
| >
|
|
 
S

Stefan B Rusynko

The better way to do it is
<%
Session("recordsource") = Request.Form("recordsource")
%>


--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I tried putting it in the grey code... it wouldn't format the red code
| properly. So I used the spooky diet (www.outfront.net) and removed the
| proper grey text which then allowed me to put in the proper sql statment.
|
| Above my html DRW page I added this:
| <%
| Session("recordsource")= request ("recordsource")
| %>
|
| This requests the variable from the form and applies it to a session
| variable.
|
| Here is my SQL query statement.
|
| SELECT * FROM "& Session("recordsource") &" WHERE (COUNTY = '::COUNTY::' OR
| HEADLINE LIKE '%::keyword::%' OR TEASE LIKE '%::keyword::%' OR STORY LIKE
| '%::keyword::%') ORDER BY SDATE DESC
|
| Thanks for the help.
|
| | > But in order for the DBRW to recognize session variables the OP may need
| > to make the tweak at
| > http://home.att.net/~codelibrary/FrontPage/tweaks.htm#DRW Script Modifications
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| > http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
| > _____________________________________________
| >
| >
| > message | > | In Code View, make your change to the SQL in the gray colored code, and
| > save
| > | your change while you're still in Code View. The change will be made to
| > the
| > | maroon colored code when you save.
| > |
| > | --
| > |
| > | ~ Kathleen Anderson
| > | Microsoft MVP - FrontPage
| > | Spider Web Woman Designs
| > | web: http://www.spiderwebwoman.com/resources/
| > | FrontPage Support: http://www.frontpagemvps.com/
| > |
| > |
| > |
| > |
| > | | > | > I'm using Frontpage, it keeps overwriting any changes I make to the
| > | > fp_sQry statement. Anyway around this.
| > | >
| > | >
| > | > | > | >> You should be able to do this as long as you are handcoding.
| > | >>
| > | >> --
| > | >> ==============================================
| > | >> Thomas A. Rowe (Microsoft MVP - FrontPage)
| > | >> ==============================================
| > | >> If you feel your current issue is a results of installing
| > | >> a Service Pack or security update, please contact
| > | >> Microsoft Product Support Services:
| > | >> http://support.microsoft.com
| > | >> If the problem can be shown to have been caused by a
| > | >> security update, then there is usually no charge for the call.
| > | >> ==============================================
| > | >>
| > | >> | > | >>>I have one DATABASE with several RECORD SOURCES:
| > | >>>
| > | >>> NEWS2006
| > | >>> NEWS2007
| > | >>> NEWS2008
| > | >>>
| > | >>> This is the SQL statement from DRW:
| > | >>>
| > | >>> fp_sQry="SELECT county FROM NEWS2006"
| > | >>>
| > | >>>
| > | >>> Is there a way to assign a variable to the record source, maybe even
| > a
| > | >>> Session varible so the user can select the record source and I can
| > pass
| > | >>> that variable over several pages.
| > | >>>
| > | >>> fp_sQry="SELECT county FROM Session ("recordsource")" <--- I
| > know
| > | >>> this doesn't work but it's the idea.
| > | >>>
| > | >>> Thanks,
| > | >>> Erik Hardtle
| > | >>>
| > | >>
| > | >>
| > | >
| > | >
| > |
| > |
| >
| >
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top