|
The FrontPage Database Results Wizard (DRW) only
processes form fields passed in the search form
(Request.Form) or fields passed in the querystring
(Request.QueryString). It does so by substituting fields
in the SQL statement. For example, SELECT * FROM
TableName WHERE ID = ::id::, substitutes the form field
id value in the SQL statement. There are a number of
methods that can be used to pass other types of query
values to the DRW.
If the user is using a form to do the query, the
variable can be passed in a hidden form field on an ASP
form page. For example;;
<input type="hidden" name="uid"
value="<%=session("uid")%>">
If the user is linking to the query from another
page, the variable can be passed in a link. For
example;
<a
href="edit.asp?uid=<%=session("uid")%>">Edit
My Information</a>
If the user is going to navigate directly to the
page, the variable needs to be added to the querystring
by redirecting back to the same page. For example;
% If Request("uid") = ""
Then Response.Redirect
Request.ServerVariables("SCRIPT_NAME") & "?uid="
& Session("uid") %> <html>
You can also 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::' |