Database Results Error

A

Art

I am attempting to query a SQL table using the DBW. I am
using FP2002

If I just list the entire database with no search
criteria, everything works fine.

The minute I add a search criteria (and a search form),
such as on zip, I get this error:

Database Results 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.

I read the article although it apples to FP2003 and it
makes no sense in my case. The only thing I can figure is
the s-attributes are incorrect but I have no idea how to
change them.

All of the fields in the SQL table are set up as varchar.

Let me know if anyone can help with this dilemna. Thanks


Here is the relevant part (I think) if my asp page.

<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-
checksum="26437" --><tr>
<td>
<!--webbot bot="DatabaseResultColumn" s-
columnnames="ID,Company,Location,Address,City,State,Zip,Tel
ephone,Facsimile" s-column="Company" 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;Company&lt;font
size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
startspan --> said:
<td>
<!--webbot bot="DatabaseResultColumn" s-
columnnames="ID,Company,Location,Address,City,State,Zip,Tel
ephone,Facsimile" s-column="Address" 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;Address&lt;font
size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
startspan --> said:
<td>
<!--webbot bot="DatabaseResultColumn" s-
columnnames="ID,Company,Location,Address,City,State,Zip,Tel
ephone,Facsimile" s-column="City" 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;City&lt;font
size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
startspan --> said:
<td>
<!--webbot bot="DatabaseResultColumn" s-
columnnames="ID,Company,Location,Address,City,State,Zip,Tel
ephone,Facsimile" s-column="State" 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;State&lt;font
size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
startspan --> said:
<td>
<!--webbot bot="DatabaseResultColumn" s-
columnnames="ID,Company,Location,Address,City,State,Zip,Tel
ephone,Facsimile" s-column="Zip" 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;Zip&lt;font
size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
startspan --> said:
<td>
<!--webbot bot="DatabaseResultColumn" s-
columnnames="ID,Company,Location,Address,City,State,Zip,Tel
ephone,Facsimile" s-column="Telephone" 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;Telephone&lt;font
size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
startspan --> said:
<td>
<!--webbot bot="DatabaseResultColumn" s-
columnnames="ID,Company,Location,Address,City,State,Zip,Tel
ephone,Facsimile" s-column="Facsimile" 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;Facsimile&lt;font
size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
startspan --> said:
</tr>
<!--webbot bot="DatabaseRegionEnd" b-
tableformat="TRUE" b-menuformat="FALSE" u-
dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside
tag="TBODY" preview="&lt;tr&gt;&lt;td colspan=64
bgcolor=&quot;#FFFF00&quot; align=&quot;left&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;"
startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-
checksum="62730" -->
 
N

Nicholas

What it boils down to is that FP uses only one SQL
statement to put results into the table created by DRW.
If you try to use different columns, it tries to write an
overcomplicated SQL statement that doesn't work.

The stuff that displays in the FP DRW and in the Normal
view are contained in the grayed out "DatabaseRegionStart"
area in the HTML view.

s-criteria="[Zip] EQ {Zip} +" s-order
s-sql="SELECT * FROM Results WHERE (Zip = '::Zip::')
ORDER BY Company"
b-procedure="FALSE" clientside SuggestedExt="asp"
s-DefaultFields="Zip="

The actual query that runs is in the ASP code below that.

fp_sQry="SELECT * FROM Results WHERE (Zip = '::ZIP::')
ORDER BY Company"
fp_sDefault="Zip="

Whatever is in s-sql and s-DefaultFields is copied into
corresponding ASP variables when you save the page. Try
setting it up exactly as above.

Or, try this:

s-criteria
s-order="[Zip] +"
b-procedure="FALSE" clientside SuggestedExt="asp"
s-DefaultFields

fp_sQry="SELECT * FROM Results WHERE (Zip = '::ZIP::')
ORDER BY Company"
fp_sDefault=""

On one page, I ended up leaving all of the above blank and
writing a custom ASP script to build the SQL statement and
put it into the fp_sQry variable. The trick with that,
though, is that FP gives you an error message and inserts
fp_sQry="" when you save it. You have to open it in
Notepad and delete the fp_sQry="" before publishing.

Another approach is don't use the DRW at all. Use
ASP/VBscript to query and write the results.
 

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