?
Solved

Basing a query on a session variable

Posted on 2002-07-03
9
Medium Priority
?
159 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
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
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

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…
Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
Suggested Courses

830 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