[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Basing a query on a session variable

Posted on 2002-07-03
9
Medium Priority
?
157 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
Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

 
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 800 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

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Question has a verified solution.

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

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…
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
Suggested Courses

649 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