Frontpage database query paramater help please

C

CharlesKiel

I'm using Frontpage 2003 and asp pages to try and view database
results. I'm having a problem either with the query I"m using or
getting the page to take the Paramater to insert into the query.
Can someone tell me why this query would work:

SELECT VIDEOS.* FROM VIDEOS, SHOWS WHERE SHOWS.VOLUME = 1 and
SHOWS.VIDEO = VIDEOS.ID




I can change the shows.volume value to anything I want in the query,
but when I try this;

SELECT VIDEOS.* FROM VIDEOS, SHOWS WHERE SHOWS.VOLUME = ::vol:: and
SHOWS.VIDEO = VIDEOS.ID

and use this url "site.com/page.asp?vol=1" if gives me the following.

----------

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.

One or more form fields were empty. You should provide default values
for all form fields that are used in the query.

----------

That article it refers to give me similar results after I've followed
it's instructions. I'm using a simiar query elsewhere on the site:

SELECT * FROM Artists where ID = ::id::

on a url: site.com/artist?id=1

and it gives me no problems. Any idea?
 
S

Stefan B Rusynko

Before the Select you need to parse the parameter being passed

vol = Replace(Request.QueryString("vol"), "'", "''")




| I'm using Frontpage 2003 and asp pages to try and view database
| results. I'm having a problem either with the query I"m using or
| getting the page to take the Paramater to insert into the query.
| Can someone tell me why this query would work:
|
| SELECT VIDEOS.* FROM VIDEOS, SHOWS WHERE SHOWS.VOLUME = 1 and
| SHOWS.VIDEO = VIDEOS.ID
|
|
|
|
| I can change the shows.volume value to anything I want in the query,
| but when I try this;
|
| SELECT VIDEOS.* FROM VIDEOS, SHOWS WHERE SHOWS.VOLUME = ::vol:: and
| SHOWS.VIDEO = VIDEOS.ID
|
| and use this url "site.com/page.asp?vol=1" if gives me the following.
|
| ----------
|
| 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.
|
| One or more form fields were empty. You should provide default values
| for all form fields that are used in the query.
|
| ----------
|
| That article it refers to give me similar results after I've followed
| it's instructions. I'm using a simiar query elsewhere on the site:
|
| SELECT * FROM Artists where ID = ::id::
|
| on a url: site.com/artist?id=1
|
| and it gives me no problems. Any idea?
|
 
C

CharlesKiel

Where do I put that? At The Beginning of my custom query? In the asp
code somewhere? I'm kinda clueless with some of this stuff.
 
S

Stefan B Rusynko

Not a part of your SQL
It is a separate ASP (VBscript) code line that must be before the Select statement line
- since you are using the DBRW enter it at the top of youe page (outside of any DBRW code) as

<% vol = Replace(Request.QueryString("vol"), "'", "''") %>




| Where do I put that? At The Beginning of my custom query? In the asp
| code somewhere? I'm kinda clueless with some of this stuff.
|
 
C

CharlesKiel

ok. Thanks for your help but I still have the same problem. Here is
my page code:


<html>
<body>

<table width="100%" border="1">
<thead>
<tr>
<th ALIGN="LEFT"><b>Artist</b></th>
</tr>
</thead>
<tbody>

<!--webbot bot="DatabaseRegionStart" s-columnnames="Artist"
s-columntypes="202" s-dataconnection="360" b-tableformat="TRUE"
b-menuformat="FALSE" s-menuchoice="Artist" s-menuvalue="Artist"
b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE"
b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0"
b-makeform="FALSE" s-recordsource s-displaycolumns="Artist" s-criteria
s-order s-sql="SELECT Videos.Artist FROM Videos, shows WHERE
shows.Volume = ::vol:: and shows.video = Videos.id" b-procedure="FALSE"
clientside suggestedext="asp" s-defaultfields="vol="
s-norecordsfound="No records returned." i-maxrecords="256"
i-groupsize="5" botid="0" u-dblib="../_fpclass/fpdblib.inc"
u-dbrgn1="../_fpclass/fpdbrgn1.inc" u-dbrgn2="../_fpclass/fpdbrgn2.inc"
tag="TBODY" preview="&lt;tr&gt;&lt;td colspan=64
bgcolor=&quot;#FFFF00&quot; width=&quot;100%&quot;&gt;&lt;font
color=&quot;#000000&quot;&gt;This is the start of a Database Results
region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;" startspan
b-UseDotNET="FALSE" CurrentExt sa-InputTypes b-DataGridFormat="FALSE"
b-DGridAlternate="TRUE" sa-CritTypes b-WasTableFormat="TRUE"
--><!--#include file="../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The
Database Results component on this page is unable to display database
content. The page must have a filename ending in '.asp', and the web
must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT Videos.Artist FROM Videos, shows WHERE shows.Volume =
::vol:: and shows.video = Videos.id"
fp_sDefault="vol="
fp_sNoRecords="<tr><td colspan=1 align=""LEFT"" width=""100%"">No
records returned.</td></tr>"
fp_sDataConn="360"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="Artist"
fp_sMenuValue="Artist"
fp_sColTypes="&Artist=202&"
fp_iDisplayCols=1
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="47746" --><tr>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="Artist"
s-column="Artist" b-tableformat="TRUE" b-hashtml="FALSE"
b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font
size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Artist&lt;font
size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan
--><%=FP_FieldVal(fp_rs,"Artist")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="15767" --></td>
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE"
b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdbrgn2.inc"
i-groupsize="5" clientside tag="TBODY" preview="&lt;tr&gt;&lt;td
colspan=64 bgcolor=&quot;#FFFF00&quot;
width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is
the end of a Database Results
region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;TR&gt;&lt;TD
VALIGN=MIDDLE COLSPAN=64&gt;&lt;NOBR&gt;&lt;INPUT TYPE=Button
VALUE=&quot; |&lt; &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot;
&lt; &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot; &gt;
&quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot; &gt;| &quot;&gt;
[1/5]&lt;/NOBR&gt;&lt;BR&gt;&lt;/td&gt;&lt;/tr&gt;" startspan
--><!--#include file="../_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="56926"
--></tbody>
</table>

</body>
</html>



Also I can't figure out why it works on another page and not this one.
My query is more complicated on this page. But I'm not sure that it
could be the problem, cause if I stick the actual value in the query
instead of the parameter, it gives me exactly what I want. also i
didn't need to parse the parameter being passed there either.
 
S

Stefan B Rusynko

That's why I don't use the DBRW and just hand code the VBscript (ASP)
- more flexibility & control



| ok. Thanks for your help but I still have the same problem. Here is
| my page code:
|
|
| <html>
| <body>
|
| <table width="100%" border="1">
| <thead>
| <tr>
| <th ALIGN="LEFT"><b>Artist</b></th>
| </tr>
| </thead>
| <tbody>
|
| <!--webbot bot="DatabaseRegionStart" s-columnnames="Artist"
| s-columntypes="202" s-dataconnection="360" b-tableformat="TRUE"
| b-menuformat="FALSE" s-menuchoice="Artist" s-menuvalue="Artist"
| b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE"
| b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0"
| b-makeform="FALSE" s-recordsource s-displaycolumns="Artist" s-criteria
| s-order s-sql="SELECT Videos.Artist FROM Videos, shows WHERE
| shows.Volume = ::vol:: and shows.video = Videos.id" b-procedure="FALSE"
| clientside suggestedext="asp" s-defaultfields="vol="
| s-norecordsfound="No records returned." i-maxrecords="256"
| i-groupsize="5" botid="0" u-dblib="../_fpclass/fpdblib.inc"
| u-dbrgn1="../_fpclass/fpdbrgn1.inc" u-dbrgn2="../_fpclass/fpdbrgn2.inc"
| tag="TBODY" preview="&lt;tr&gt;&lt;td colspan=64
| bgcolor=&quot;#FFFF00&quot; width=&quot;100%&quot;&gt;&lt;font
| color=&quot;#000000&quot;&gt;This is the start of a Database Results
| region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;" startspan
| b-UseDotNET="FALSE" CurrentExt sa-InputTypes b-DataGridFormat="FALSE"
| b-DGridAlternate="TRUE" sa-CritTypes b-WasTableFormat="TRUE"
| --><!--#include file="../_fpclass/fpdblib.inc"-->
| <% if 0 then %>
| <SCRIPT Language="JavaScript">
| document.write("<div style='background: yellow; color: black;'>The
| Database Results component on this page is unable to display database
| content. The page must have a filename ending in '.asp', and the web
| must be hosted on a server that supports Active Server Pages.</div>");
| </SCRIPT>
| <% end if %>
| <%
| fp_sQry="SELECT Videos.Artist FROM Videos, shows WHERE shows.Volume =
| ::vol:: and shows.video = Videos.id"
| fp_sDefault="vol="
| fp_sNoRecords="<tr><td colspan=1 align=""LEFT"" width=""100%"">No
| records returned.</td></tr>"
| fp_sDataConn="360"
| fp_iMaxRecords=256
| fp_iCommandType=1
| fp_iPageSize=5
| fp_fTableFormat=True
| fp_fMenuFormat=False
| fp_sMenuChoice="Artist"
| fp_sMenuValue="Artist"
| fp_sColTypes="&Artist=202&"
| fp_iDisplayCols=1
| fp_fCustomQuery=True
| BOTID=0
| fp_iRegion=BOTID
| %>
| <!--#include file="../_fpclass/fpdbrgn1.inc"-->
| <!--webbot bot="DatabaseRegionStart" endspan i-checksum="47746" --><tr>
| <td>
| <!--webbot bot="DatabaseResultColumn" s-columnnames="Artist"
| s-column="Artist" b-tableformat="TRUE" b-hashtml="FALSE"
| b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font
| size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Artist&lt;font
| size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan
| --><%=FP_FieldVal(fp_rs,"Artist")%><!--webbot
| bot="DatabaseResultColumn" endspan i-checksum="15767" --></td>
| </tr>
| <!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE"
| b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdbrgn2.inc"
| i-groupsize="5" clientside tag="TBODY" preview="&lt;tr&gt;&lt;td
| colspan=64 bgcolor=&quot;#FFFF00&quot;
| width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is
| the end of a Database Results
| region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;TR&gt;&lt;TD
| VALIGN=MIDDLE COLSPAN=64&gt;&lt;NOBR&gt;&lt;INPUT TYPE=Button
| VALUE=&quot; |&lt; &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot;
| &lt; &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot; &gt;
| &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot; &gt;| &quot;&gt;
| [1/5]&lt;/NOBR&gt;&lt;BR&gt;&lt;/td&gt;&lt;/tr&gt;" startspan
| --><!--#include file="../_fpclass/fpdbrgn2.inc"-->
| <!--webbot bot="DatabaseRegionEnd" endspan i-checksum="56926"
| --></tbody>
| </table>
|
| </body>
| </html>
|
|
|
| Also I can't figure out why it works on another page and not this one.
| My query is more complicated on this page. But I'm not sure that it
| could be the problem, cause if I stick the actual value in the query
| instead of the parameter, it gives me exactly what I want. also i
| didn't need to parse the parameter being passed there either.
|
 
C

CharlesKiel

I fixed it. It's Frontpage 2003. I uploaded the _fpclass folder from
Frontpage 2000 to my sites directory and it works like a charm. no
screwing with the code or anything.
 

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