?
Solved

Basing a query on a session variable

Posted on 2002-07-03
9
Medium Priority
?
156 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
WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

 
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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

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…
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 properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
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…
Suggested Courses

777 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