Amending SQL Statements in <!--webbot

N

Nick Halfpenny

Following a previous question that I asked yesterday.

Using the Database results wizard in Front Page 2002, I’ve created a
standard database enquiry page. This works fine, but my ultimate goal is to
create a complex SQL statement outside of this page, and insert the statement
into the <!—webbot procedure. This will give me greater flexiablity in
creating a SQL statement from the critera entered by a user. I can create the
SQL statement and pass it to a field within a ASP page.

For simplicity, in the example below, I’ve just shown part of my ASP page.
I’ve hard-coded the SQL statement in for this example. I’ve created a SQL
statement and put it into a field called TEST1. I want to be able to use
this field inside the <!—webbot against the S-SQL= item.

No matter how I present the TEST1 field to the S-SQL statement, it will not
use the value held within it. I’ve tried ::TEST1::, <%TEST1%>, etc, nothing
works.

I’m obviously not presenting the data incorrectly. Could someone kindly drop
me some hints, as I’m pulling teeth !!

ASP script example:

<%
dim test1
test1="SELECT * FROM Sol_Voidlist WHERE bedrooms=2"
response.write test1
%>
<!--webbot bot="DatabaseRegionStart"
s-columnnames="propref,houseno,proadd1,heatcode,bedrooms,proptypecode,area,offers,diff_in_weeks,voidstart,keyretdate,relettarget,actrelet,udd15,voidaltkey,voidsuffix,voidtype,eventbi,eventbidate,eventfcas,eventfcasdate,eventffl,eventffldate,sfacode,freetext"
s-columntypes="129,129,129,129,2,129,200,2,2,135,135,135,135,129,3,2,129,129,135,129,135,129,135,129,200"
s-dataconnection="Academy_Live" b-tableformat="TRUE" b-menuformat="FALSE"
s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="TRUE"
b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE"
i-listformat="0" b-makeform="TRUE" s-recordsource="Sol_voidlist"
s-displaycolumns="propref,houseno,proadd1,heatcode,bedrooms,proptypecode,area,offers,diff_in_weeks,voidstart,keyretdate,relettarget,actrelet,udd15,voidaltkey,voidsuffix,voidtype,eventbi,eventbidate,eventfcas,eventfcasdate,eventffl,eventffldate,sfacode,freetext"
s-criteria s-order s-sql=::test1:: b-procedure="FALSE" clientside
suggestedext="asp" s-defaultfields="" s-norecordsfound="No records returned."
i-maxrecords="0" i-groupsize="0" botid="0"
u-dblib="../../_fpclass/fpdblib.inc" u-dbrgn1="../../_fpclass/fpdbrgn1.inc"
u-dbrgn2="../../_fpclass/fpdbrgn2.inc" tag="TBODY" preview="<tr><td
colspan=64 bgcolor="#FFFF00" align="left" width="100%"><font
color="#000000">This is the start of a Database Results
region.</font></td></tr>" startspan s-NoRecordsFound --><!--#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="::test1::"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=25 align=left width=""100%"">No records
returned.</td></tr>"
fp_sDataConn="Academy_Live"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&propref=129&houseno=129&proadd1=129&heatcode=129&bedrooms=2&proptypecode=129&area=200&offers=2&diff_in_weeks=2&voidstart=135&keyretdate=135&relettarget=135&actrelet=135&udd15=129&voidaltkey=3&voidsuffix=2&voidtype=129&eventbi=129&eventbidate=135&eventfcas=129&eventfcasdate=135&eventffl=129&eventffldate=135&sfacode=129&freetext=200&"
fp_iDisplayCols=25
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>

Best Regards,

Nick
 

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

Similar Threads


Top