How to pass a parameter into the Database Result Wizard ???

G

Guenter

Hi,

I have an .asp file which gets called with a parameter representing a
product id:

DisplayProductDetails.asp?productid=<some number>

Then in DisplayProductDetails.asp I am retrieving the parameter by:

<% pid = Request.QueryString ("productid") %>

Now I want to use the value of the 'pid' parameter in the SQL statement I
create with the Database Result Wizard:

Going to "Database Result Properties"->"SQL Server"->"Custom Query"->"Edit"
and adding the query:

SELECT PRODNAME
FROM PRODUCT_RECORD
WHERE (PRODID = ::pid::)

The code generated by Frontpage is:

....
<%
fp_sQry="SELECT PRODNAME FROM RODUCT_RECORD WHERE (PRODID = ::pid::)"
fp_sDefault="pid="
....
%>
....

When I open the DisplayProductDetails.asp in IE it shows the follwoing error:

"Database Results Wizard Error
The operation failed. If this continues, please contact your server
administrator."

Anybody any ideas ?

Thanks !!!

Günter
 
G

Guenter

One more piece of info.

When I replace

fp_sQry="SELECT PRODNAME FROM RODUCT_RECORD WHERE (PRODID = ::pid::)"

with

fp_sQry="SELECT PRODNAME FROM RODUCT_RECORD WHERE PRODID = "&pid

it works. Only problem: Frontpage overwrites this change when saving the
file ?!?!

Guenter
 
T

Thomas A. Rowe

Try saving the page after you make the change while in code/html view.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
G

Guenter

Thanks for answering !

I tried to save it in code/html view (tried that already before) and I get
the pop-up "The contents of a FrontPage component have been modified. The
contents will be overwritten when you save this page."
 
S

Stefan B Rusynko

When using the DBRW you must be editing the DBRW grey code

--

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


| Thanks for answering !
|
| I tried to save it in code/html view (tried that already before) and I get
| the pop-up "The contents of a FrontPage component have been modified. The
| contents will be overwritten when you save this page."
|
| "Thomas A. Rowe" wrote:
|
| > Try saving the page after you make the change while in code/html view.
| >
| > --
| > ==============================================
| > Thomas A. Rowe (Microsoft MVP - FrontPage)
| > ==============================================
| > If you feel your current issue is a results of installing
| > a Service Pack or security update, please contact
| > Microsoft Product Support Services:
| > http://support.microsoft.com
| > If the problem can be shown to have been caused by a
| > security update, then there is usually no charge for the call.
| > ==============================================
| >
| > | > > One more piece of info.
| > >
| > > When I replace
| > >
| > > fp_sQry="SELECT PRODNAME FROM RODUCT_RECORD WHERE (PRODID = ::pid::)"
| > >
| > > with
| > >
| > > fp_sQry="SELECT PRODNAME FROM RODUCT_RECORD WHERE PRODID = "&pid
| > >
| > > it works. Only problem: Frontpage overwrites this change when saving the
| > > file ?!?!
| > >
| > > Guenter
| > >
| > >
| > > "Guenter" wrote:
| > >
| > >> Hi,
| > >>
| > >> I have an .asp file which gets called with a parameter representing a
| > >> product id:
| > >>
| > >> DisplayProductDetails.asp?productid=<some number>
| > >>
| > >> Then in DisplayProductDetails.asp I am retrieving the parameter by:
| > >>
| > >> <% pid = Request.QueryString ("productid") %>
| > >>
| > >> Now I want to use the value of the 'pid' parameter in the SQL statement I
| > >> create with the Database Result Wizard:
| > >>
| > >> Going to "Database Result Properties"->"SQL Server"->"Custom Query"->"Edit"
| > >> and adding the query:
| > >>
| > >> SELECT PRODNAME
| > >> FROM PRODUCT_RECORD
| > >> WHERE (PRODID = ::pid::)
| > >>
| > >> The code generated by Frontpage is:
| > >>
| > >> ...
| > >> <%
| > >> fp_sQry="SELECT PRODNAME FROM RODUCT_RECORD WHERE (PRODID = ::pid::)"
| > >> fp_sDefault="pid="
| > >> ...
| > >> %>
| > >> ...
| > >>
| > >> When I open the DisplayProductDetails.asp in IE it shows the follwoing error:
| > >>
| > >> "Database Results Wizard Error
| > >> The operation failed. If this continues, please contact your server
| > >> administrator."
| > >>
| > >> Anybody any ideas ?
| > >>
| > >> Thanks !!!
| > >>
| > >> Günter
| > >>
| > >>
| > >>
| >
| >
| >
 

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