Frontpage 2003 technique for Database Results WIzard

G

Guest

I am using the Frontpage 2003 Database Results Wizard to retrieve a list of
rows from a database table. I want to filter the data based on the user id
logged on to the website. I have a session variable that contains the user
id. I cannot find a way to incorporate this into the SQL. I can let the
wizard generate a form that needs the user id (nad password). This works but
it is redundant. I already have a login routine that has accomplihed this.
I just want to grab the userid inser it into the "where" clause and filter
the results from the database with rows for that user.
 
S

Stefan B Rusynko

See http://home.att.net/~codelibrary/FrontPage/tweaks.htm#Link

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I am using the Frontpage 2003 Database Results Wizard to retrieve a list of
| rows from a database table. I want to filter the data based on the user id
| logged on to the website. I have a session variable that contains the user
| id. I cannot find a way to incorporate this into the SQL. I can let the
| wizard generate a form that needs the user id (nad password). This works but
| it is redundant. I already have a login routine that has accomplihed this.
| I just want to grab the userid inser it into the "where" clause and filter
| the results from the database with rows for that user.
|
| --
| Max M.
 
G

Guest

Stefan,

This is exactly what I need. However I still cannot get it to work.

Here is the code in I added fpdbrgn1.inc:

if len(fp_sValue) = 0 then fp_sValue = Request.QueryString(fp_sField)
' ECSS Custom Code - (The following line was added 11/7/2005 by Max Michaels)
if len(fp_sValue) = 0 then fp_sValue = Session(fp_sField)

Here is code from th page I am working with

<%
If Len(Session("txtAgentUserID")) = 0 Then
Response.Write "<b>You are not logged on.</b>"
Else
Response.Write "<b>" & Session("txtAgentUserID") & "</b>"
End If
%>

My assumption is that the variable txtAgentUserID can now be used in the DRW
for running my query.

Here is the custom query I run:

SELECT DOC_Name as 'Document',
ECSS_Date as 'ECSS Date',
Carrier_Date as 'Carrier Date',
Carrier_On_File as 'Filing Valid'
FROM tblCheckList
WHERE UID = '::txtAgentUserID::'

When I run this I receive the following error message:

Database Results Wizard Error
Your page contains a query with user input parameters that could not be
resolved.
This could happen if your DatabaseRegionStart webbot has an empty or missing
s-columnnames or s-columntypes attributes.
You may need to read Microsoft Knowledge Base Article 817029.

Any thoughts are appreciated.






The following code is in the beginning of the page I am working with:
 
S

Stefan B Rusynko

You don't use response write to set the variable in the page

<%
If Len(Session("txtAgentUserID")) = 0 Then
Response.redirect "theLoginPage.asp"
'you want to send them to login page here to prevent errors in the DBWR
Else
txtAgentUserID = Session("txtAgentUserID")
'you are declaring the variable (using =) here for use in the DBRW
End If
%>


--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| Stefan,
|
| This is exactly what I need. However I still cannot get it to work.
|
| Here is the code in I added fpdbrgn1.inc:
|
| if len(fp_sValue) = 0 then fp_sValue = Request.QueryString(fp_sField)
| ' ECSS Custom Code - (The following line was added 11/7/2005 by Max Michaels)
| if len(fp_sValue) = 0 then fp_sValue = Session(fp_sField)
|
| Here is code from th page I am working with
|
| <%
| If Len(Session("txtAgentUserID")) = 0 Then
| Response.Write "<b>You are not logged on.</b>"
| Else
| Response.Write "<b>" & Session("txtAgentUserID") & "</b>"
| End If
| %>
|
| My assumption is that the variable txtAgentUserID can now be used in the DRW
| for running my query.
|
| Here is the custom query I run:
|
| SELECT DOC_Name as 'Document',
| ECSS_Date as 'ECSS Date',
| Carrier_Date as 'Carrier Date',
| Carrier_On_File as 'Filing Valid'
| FROM tblCheckList
| WHERE UID = '::txtAgentUserID::'
|
| When I run this I receive the following error message:
|
| Database Results Wizard Error
| Your page contains a query with user input parameters that could not be
| resolved.
| This could happen if your DatabaseRegionStart webbot has an empty or missing
| s-columnnames or s-columntypes attributes.
| You may need to read Microsoft Knowledge Base Article 817029.
|
| Any thoughts are appreciated.
|
|
|
|
|
|
| The following code is in the beginning of the page I am working with:
|
|
|
| --
| Max M.
|
|
| "Stefan B Rusynko" wrote:
|
| > See http://home.att.net/~codelibrary/FrontPage/tweaks.htm#Link
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| > http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
| > _____________________________________________
| >
| >
| > |I am using the Frontpage 2003 Database Results Wizard to retrieve a list of
| > | rows from a database table. I want to filter the data based on the user id
| > | logged on to the website. I have a session variable that contains the user
| > | id. I cannot find a way to incorporate this into the SQL. I can let the
| > | wizard generate a form that needs the user id (nad password). This works but
| > | it is redundant. I already have a login routine that has accomplihed this.
| > | I just want to grab the userid inser it into the "where" clause and filter
| > | the results from the database with rows for that user.
| > |
| > | --
| > | Max M.
| >
| >
| >
 
G

Guest

Stefan, Thanks for your time. I really appreciate it.

I changed the code and get the same results. I have a Login.inc file in the
_private directory that insures you are logged in before this page launches.
I left in the "if" logic and wrote the variable just as a test tool. SO for
the tome being I left it in but this will never happen. Here is the code as
I changed it.

FYI, I am heading off for the day job, so I won't be looking at this until
this evening.

<%
If Len(Session("txtAgentUserID")) = 0 Then
Response.Write "<b>You are not logged on.</b>"
Else
txtAgentUserID = Session("txtAgentUserID")
' Response.Write "<b>" & Session("txtAgentUserID") & "</b>"
End If
%>


--
Max M.


Stefan B Rusynko said:
You don't use response write to set the variable in the page

<%
If Len(Session("txtAgentUserID")) = 0 Then
Response.redirect "theLoginPage.asp"
'you want to send them to login page here to prevent errors in the DBWR
Else
txtAgentUserID = Session("txtAgentUserID")
'you are declaring the variable (using =) here for use in the DBRW
End If
%>


--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| Stefan,
|
| This is exactly what I need. However I still cannot get it to work.
|
| Here is the code in I added fpdbrgn1.inc:
|
| if len(fp_sValue) = 0 then fp_sValue = Request.QueryString(fp_sField)
| ' ECSS Custom Code - (The following line was added 11/7/2005 by Max Michaels)
| if len(fp_sValue) = 0 then fp_sValue = Session(fp_sField)
|
| Here is code from th page I am working with
|
| <%
| If Len(Session("txtAgentUserID")) = 0 Then
| Response.Write "<b>You are not logged on.</b>"
| Else
| Response.Write "<b>" & Session("txtAgentUserID") & "</b>"
| End If
| %>
|
| My assumption is that the variable txtAgentUserID can now be used in the DRW
| for running my query.
|
| Here is the custom query I run:
|
| SELECT DOC_Name as 'Document',
| ECSS_Date as 'ECSS Date',
| Carrier_Date as 'Carrier Date',
| Carrier_On_File as 'Filing Valid'
| FROM tblCheckList
| WHERE UID = '::txtAgentUserID::'
|
| When I run this I receive the following error message:
|
| Database Results Wizard Error
| Your page contains a query with user input parameters that could not be
| resolved.
| This could happen if your DatabaseRegionStart webbot has an empty or missing
| s-columnnames or s-columntypes attributes.
| You may need to read Microsoft Knowledge Base Article 817029.
|
| Any thoughts are appreciated.
|
|
|
|
|
|
| The following code is in the beginning of the page I am working with:
|
|
|
| --
| Max M.
|
|
| "Stefan B Rusynko" wrote:
|
| > See http://home.att.net/~codelibrary/FrontPage/tweaks.htm#Link
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| > http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
| > _____________________________________________
| >
| >
| > |I am using the Frontpage 2003 Database Results Wizard to retrieve a list of
| > | rows from a database table. I want to filter the data based on the user id
| > | logged on to the website. I have a session variable that contains the user
| > | id. I cannot find a way to incorporate this into the SQL. I can let the
| > | wizard generate a form that needs the user id (nad password). This works but
| > | it is redundant. I already have a login routine that has accomplihed this.
| > | I just want to grab the userid inser it into the "where" clause and filter
| > | the results from the database with rows for that user.
| > |
| > | --
| > | Max M.
| >
| >
| >
 
G

Guest

Just in case anyone is having a similar problem I thought an update is
warranted. My query is now working thanks to the directions from Stefan.
The last piece of the puzzle was my Service Pack level for Frontpage Office
2003. I was not running SP2 and this procedure continued to fail. I
upgraded to SP2 and followed the instructions and everything now works.
--
Max M.


Max Michaels said:
Stefan, Thanks for your time. I really appreciate it.

I changed the code and get the same results. I have a Login.inc file in the
_private directory that insures you are logged in before this page launches.
I left in the "if" logic and wrote the variable just as a test tool. SO for
the tome being I left it in but this will never happen. Here is the code as
I changed it.

FYI, I am heading off for the day job, so I won't be looking at this until
this evening.

<%
If Len(Session("txtAgentUserID")) = 0 Then
Response.Write "<b>You are not logged on.</b>"
Else
txtAgentUserID = Session("txtAgentUserID")
' Response.Write "<b>" & Session("txtAgentUserID") & "</b>"
End If
%>


--
Max M.


Stefan B Rusynko said:
You don't use response write to set the variable in the page

<%
If Len(Session("txtAgentUserID")) = 0 Then
Response.redirect "theLoginPage.asp"
'you want to send them to login page here to prevent errors in the DBWR
Else
txtAgentUserID = Session("txtAgentUserID")
'you are declaring the variable (using =) here for use in the DBRW
End If
%>


--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| Stefan,
|
| This is exactly what I need. However I still cannot get it to work.
|
| Here is the code in I added fpdbrgn1.inc:
|
| if len(fp_sValue) = 0 then fp_sValue = Request.QueryString(fp_sField)
| ' ECSS Custom Code - (The following line was added 11/7/2005 by Max Michaels)
| if len(fp_sValue) = 0 then fp_sValue = Session(fp_sField)
|
| Here is code from th page I am working with
|
| <%
| If Len(Session("txtAgentUserID")) = 0 Then
| Response.Write "<b>You are not logged on.</b>"
| Else
| Response.Write "<b>" & Session("txtAgentUserID") & "</b>"
| End If
| %>
|
| My assumption is that the variable txtAgentUserID can now be used in the DRW
| for running my query.
|
| Here is the custom query I run:
|
| SELECT DOC_Name as 'Document',
| ECSS_Date as 'ECSS Date',
| Carrier_Date as 'Carrier Date',
| Carrier_On_File as 'Filing Valid'
| FROM tblCheckList
| WHERE UID = '::txtAgentUserID::'
|
| When I run this I receive the following error message:
|
| Database Results Wizard Error
| Your page contains a query with user input parameters that could not be
| resolved.
| This could happen if your DatabaseRegionStart webbot has an empty or missing
| s-columnnames or s-columntypes attributes.
| You may need to read Microsoft Knowledge Base Article 817029.
|
| Any thoughts are appreciated.
|
|
|
|
|
|
| The following code is in the beginning of the page I am working with:
|
|
|
| --
| Max M.
|
|
| "Stefan B Rusynko" wrote:
|
| > See http://home.att.net/~codelibrary/FrontPage/tweaks.htm#Link
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| > http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
| > _____________________________________________
| >
| >
| > |I am using the Frontpage 2003 Database Results Wizard to retrieve a list of
| > | rows from a database table. I want to filter the data based on the user id
| > | logged on to the website. I have a session variable that contains the user
| > | id. I cannot find a way to incorporate this into the SQL. I can let the
| > | wizard generate a form that needs the user id (nad password). This works but
| > | it is redundant. I already have a login routine that has accomplihed this.
| > | I just want to grab the userid inser it into the "where" clause and filter
| > | the results from the database with rows for that user.
| > |
| > | --
| > | Max M.
| >
| >
| >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top