PC Review


Reply
Thread Tools Rate Thread

Assign RECORD SOURCE to variable

 
 
TV12 Webmaster
Guest
Posts: n/a
 
      15th Feb 2006
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


 
Reply With Quote
 
 
 
 
Thomas A. Rowe
Guest
Posts: n/a
 
      15th Feb 2006
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.
==============================================

"TV12 Webmaster" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>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
>



 
Reply With Quote
 
TV12 Webmaster
Guest
Posts: n/a
 
      15th Feb 2006
I'm using Frontpage, it keeps overwriting any changes I make to the fp_sQry
statement. Anyway around this.


"Thomas A. Rowe" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
> ==============================================
>
> "TV12 Webmaster" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>>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
>>

>
>



 
Reply With Quote
 
Kathleen Anderson [MVP - FrontPage]
Guest
Posts: n/a
 
      15th Feb 2006
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/




"TV12 Webmaster" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm using Frontpage, it keeps overwriting any changes I make to the
> fp_sQry statement. Anyway around this.
>
>
> "Thomas A. Rowe" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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.
>> ==============================================
>>
>> "TV12 Webmaster" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>>>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
>>>

>>
>>

>
>



 
Reply With Quote
 
Stefan B Rusynko
Guest
Posts: n/a
 
      16th Feb 2006
But in order for the DBRW to recognize session variables the OP may need to make the tweak at
http://home.att.net/~codelibrary/Fro...0Modifications

--

_____________________________________________
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/FrontPa...3/Default.aspx
_____________________________________________


"Kathleen Anderson [MVP - FrontPage]" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
| 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/
|
|
|
|
| "TV12 Webmaster" <(E-Mail Removed)> wrote in message
| news:(E-Mail Removed)...
| > I'm using Frontpage, it keeps overwriting any changes I make to the
| > fp_sQry statement. Anyway around this.
| >
| >
| > "Thomas A. Rowe" <(E-Mail Removed)> wrote in message
| > news:(E-Mail Removed)...
| >> 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.
| >> ==============================================
| >>
| >> "TV12 Webmaster" <(E-Mail Removed)> wrote in message
| >> news:%(E-Mail Removed)...
| >>>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
| >>>
| >>
| >>
| >
| >
|
|


 
Reply With Quote
 
TV12 Webmaster
Guest
Posts: n/a
 
      16th Feb 2006
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" <(E-Mail Removed)> wrote in message
news:OId$(E-Mail Removed)...
> But in order for the DBRW to recognize session variables the OP may need
> to make the tweak at
> http://home.att.net/~codelibrary/Fro...0Modifications
>
> --
>
> _____________________________________________
> 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/FrontPa...3/Default.aspx
> _____________________________________________
>
>
> "Kathleen Anderson [MVP - FrontPage]" <(E-Mail Removed)> wrote in
> message news:(E-Mail Removed)...
> | 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/
> |
> |
> |
> |
> | "TV12 Webmaster" <(E-Mail Removed)> wrote in message
> | news:(E-Mail Removed)...
> | > I'm using Frontpage, it keeps overwriting any changes I make to the
> | > fp_sQry statement. Anyway around this.
> | >
> | >
> | > "Thomas A. Rowe" <(E-Mail Removed)> wrote in message
> | > news:(E-Mail Removed)...
> | >> 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.
> | >> ==============================================
> | >>
> | >> "TV12 Webmaster" <(E-Mail Removed)> wrote in message
> | >> news:%(E-Mail Removed)...
> | >>>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
> | >>>
> | >>
> | >>
> | >
> | >
> |
> |
>
>



 
Reply With Quote
 
Stefan B Rusynko
Guest
Posts: n/a
 
      16th Feb 2006
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/FrontPa...3/Default.aspx
_____________________________________________


"TV12 Webmaster" <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)...
|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" <(E-Mail Removed)> wrote in message
| news:OId$(E-Mail Removed)...
| > But in order for the DBRW to recognize session variables the OP may need
| > to make the tweak at
| > http://home.att.net/~codelibrary/Fro...0Modifications
| >
| > --
| >
| > _____________________________________________
| > 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/FrontPa...3/Default.aspx
| > _____________________________________________
| >
| >
| > "Kathleen Anderson [MVP - FrontPage]" <(E-Mail Removed)> wrote in
| > message news:(E-Mail Removed)...
| > | 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/
| > |
| > |
| > |
| > |
| > | "TV12 Webmaster" <(E-Mail Removed)> wrote in message
| > | news:(E-Mail Removed)...
| > | > I'm using Frontpage, it keeps overwriting any changes I make to the
| > | > fp_sQry statement. Anyway around this.
| > | >
| > | >
| > | > "Thomas A. Rowe" <(E-Mail Removed)> wrote in message
| > | > news:(E-Mail Removed)...
| > | >> 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.
| > | >> ==============================================
| > | >>
| > | >> "TV12 Webmaster" <(E-Mail Removed)> wrote in message
| > | >> news:%(E-Mail Removed)...
| > | >>>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
| > | >>>
| > | >>
| > | >>
| > | >
| > | >
| > |
| > |
| >
| >
|
|


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
assign record source GBA Microsoft Access Reports 5 9th May 2009 02:53 AM
Variable not assign when using query as form's record source. Dennis Microsoft Access Form Coding 3 28th Mar 2009 04:15 AM
How to Assign JavaScript variable to Jsp Variable Ranjan Microsoft ASP .NET 1 10th Apr 2007 04:35 PM
Variable Record Source =?Utf-8?B?TWFyY28=?= Microsoft Access Reports 3 2nd Feb 2007 04:13 PM
Form Record Source Variable =?Utf-8?B?SGFuc2ZvcmQgY29ybmV0dA==?= Microsoft Access Forms 9 31st Jan 2007 03:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:52 PM.