Solved

Basing a query on a session variable

Posted on 2002-07-03
9
155 Views
Last Modified: 2013-12-24
I developed a page that displays data from an SQL server database. I have a session variable that identifies the user.

How can I use this variable in a where clause. The ASP code is all generated by FrontPage.
0
Comment
Question by:alexandram
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 12

Expert Comment

by:Wouter Boevink
ID: 7131614
Show the code please
0
 
LVL 19

Expert Comment

by:webwoman
ID: 7133291
FrontPage isn't going to do this for you. You're going to have to edit the code yourself.
0
 

Expert Comment

by:ramesh411
ID: 7150864
Display your Code
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 2

Expert Comment

by:Leon Summers
ID: 7176588
Hi alexandram,

The easiest way is to post the session variable that identifies the user to the page that displays the data and then add the field into the criteria for that data. This way the query will build itself.

So when the user clicks a buttom to display the data his name is also sent along.

Or

If you wish to edit the query yourself you will need to post your data as stated by the others!!!!.
0
 

Accepted Solution

by:
PigoPigo earned 200 total points
ID: 7359310
You can modify the script that the the DRW uses to create the query to process values other than Request.Form or Request.QuerySting. You can also modify the same script to use a Session object, Application Object or Request Objects (Form, QueryString, ServerVariables, Cookies, Certificates), as follows;

Tools... Web Settings... Advanced...Show documents in hidden directories.
Open _fpclass/fpdbrgn1.inc
Find the line of code in the file about 1/3rd the way down, in the 'replace any input parameters in query string' section;
 
if len(fp_sValue) = 0 then fp_sValue = Request.QueryString(fp_sField)

Add one (or all) of these lines immediately below;
 
if len(fp_sValue) = 0 then fp_sValue = Session(fp_sField)
if len(fp_sValue) = 0 then fp_sValue = Application(fp_sField)
if len(fp_sValue) = 0 then fp_sValue = Request(fp_sField)

Use a custom DRW to query on the object by it's name. For example, use a Session Login ID (e.g. customernumber) or the Windows Logon Username (e.g. LOGON_USER) in a query;
SELECT * FROM TableName WHERE CustomerNumber = '::customernumber::'
SELECT * FROM TableName WHERE Username = '::LOGON_USER::'
0
 
LVL 19

Expert Comment

by:webwoman
ID: 7363460
PigoPigo, it's standard procedure here to post comments, and allow the poster to decide if it's a valid answer or not. Since they haven't been back in 3 months, it's likely they either don't know how to edit/view the code, or they've forgotten about the question (or both).

And besides...
they're using FrontPage. It's highly unlikely that they'll even understand one iota of what you posted. ;-)
0
 

Expert Comment

by:PigoPigo
ID: 7371528
0
 

Expert Comment

by:PigoPigo
ID: 7371532
0
 

Expert Comment

by:PigoPigo
ID: 7371540
0

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question