F
FlyBoy
I've searched through every newsgroup and Googled until my fingers are sore,
but haven't gotten any closer. Just dense I guess. I also apologize in
advance for this post being so verbose.
Using FP2003 on XPPro, with an Access 2003 database with all the proper
connections, I have an .asp page that I want to use for a query. The client
wants me to use 2 javascript pop-up calendars that fill dates into text
boxes. Using the values from these text boxes, I want to search for records
between a start and end date. Here's the SQL statement:
SELECT IM_tblImpacts.ImpactDate, IM_tblImpacts.ImpactType,
IM_tblImpacts.ImpactingProject, IM_tblImpacts.ImpactedDepartment,
IM_tblImpacts.ImpactDetails
FROM IM_tblImpacts
WHERE (((IM_tblImpacts.ImpactDate) Between ::StartDate:: And ::EndDate:);
When I first open the page, I get:
Database Results Error
Description: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing
operator) in query expression '(((IM_tblImpacts.ImpactDate) Between And ))'.
Number: -2147217900 (0x80040E14)
Source: Microsoft OLE DB Provider for ODBC Drivers
One or more form fields were empty. You should provide default values for
all form fields that are used in the query.
If I choose 2 dates and click the submit button, I get "No Records
Returned", even though there are records in the date range.
Using the wizards, different forms of code, etc, I just can't get this to
work.
Page code:
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>ClientName University Training Request</title>
<script language="javascript" type="text/javascript"
src="datetimepicker.js"></script>
</head>
<body>
<div align="center">
<table style= border="0" width="604" id="table1">
<tr>
<td>
<div style="border-style: ridge">
<p style="margin-top: 0; margin-bottom: 0" align="center">
<img border="0" src="images/ClientName.bmp" width="593" height="81"></p>
</div>
<div align="center">
<table border="0" width="598" id="table2">
<tr>
<td valign="top">
<p align="center"><b><font face="Tahoma" size="4" color="#000080">
Query Test</font></b></p>
<p align="left"> </p>
<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" U-File="../_private/form_results.csv"
S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
<p align="left"><b><font face="Tahoma" color="#000080">Start Date: </font>
<input id="start" type="text" size="18" name="StartDate"><a
href="javascript:NewCal('start','MMddyyyy')"><img src="cal.gif" width="16"
height="16" border="0" alt="Pick a date"></a><br>
<font face="Tahoma" color="#000080"> End Date: </font>
<input id="end" type="text" size="18" name="EndDate"><a
href="javascript:NewCal('end','MMddyyyy')"><img src="cal.gif" width="16"
height="16" border="0" alt="Pick a date"></a></b></p>
<table width="100%">
<thead>
<tr>
<th ALIGN="LEFT"><b>ImpactDate</b></th>
<th ALIGN="LEFT"><b>ImpactType</b></th>
<th ALIGN="LEFT"><b>ImpactingProject</b></th>
<th ALIGN="LEFT"><b>ImpactedDepartment</b></th>
<th ALIGN="LEFT"><b>ImpactDetails</b></th>
</tr>
</thead>
<tbody>
<!--webbot bot="DatabaseRegionStart"
s-columnnames="ImpactDate,ImpactType,ImpactingProject,ImpactedDepartment,ImpactDetails"
s-columntypes="135,202,202,202,203" s-dataconnection="X1"
b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice s-menuvalue
b-tableborder="FALSE" b-tableexpand="TRUE" b-tableheader="TRUE"
b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0"
b-makeform="FALSE" s-recordsource
s-displaycolumns="ImpactDate,ImpactType,ImpactingProject,ImpactedDepartment,ImpactDetails"
s-criteria s-order s-sql="SELECT IM_tblImpacts.ImpactDate,
IM_tblImpacts.ImpactType, IM_tblImpacts.ImpactingProject,
IM_tblImpacts.ImpactedDepartment, IM_tblImpacts.ImpactDetails<br>FROM
IM_tblImpacts<br>WHERE (((IM_tblImpacts.ImpactDate) Between ::StartDate:: And
::EndDate:);" b-procedure="FALSE" clientside suggestedext="asp"
s-defaultfields="StartDate=&EndDate=" s-norecordsfound="No records returned."
i-maxrecords="256" 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" width="100%"><font color="#000000">This is the start of a
Database Results region.</font></td></tr>" startspan --><!--#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 IM_tblImpacts.ImpactDate, IM_tblImpacts.ImpactType,
IM_tblImpacts.ImpactingProject, IM_tblImpacts.ImpactedDepartment,
IM_tblImpacts.ImpactDetails FROM IM_tblImpacts WHERE
(((IM_tblImpacts.ImpactDate) Between ::StartDate:: And ::EndDate:);"
fp_sDefault="StartDate=&EndDate="
fp_sNoRecords="<tr><td colspan=5 align=""LEFT"" width=""100%"">No records
returned.</td></tr>"
fp_sDataConn="X1"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ImpactDate=135&ImpactType=202&ImpactingProject=202&ImpactedDepartment=202&ImpactDetails=203&"
fp_iDisplayCols=5
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="16048" --><tr>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ImpactDate,ImpactType,ImpactingProject,ImpactedDepartment,ImpactDetails"
s-column="ImpactDate" b-tableformat="TRUE" b-hashtml="FALSE"
b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1"><<</font>ImpactDate<font size="-1">>></font>" startspan
--><%=FP_FieldVal(fp_rs,"ImpactDate")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="28699" --></td>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ImpactDate,ImpactType,ImpactingProject,ImpactedDepartment,ImpactDetails"
s-column="ImpactType" b-tableformat="TRUE" b-hashtml="FALSE"
b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1"><<</font>ImpactType<font size="-1">>></font>" startspan
--><%=FP_FieldVal(fp_rs,"ImpactType")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="29467" --></td>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ImpactDate,ImpactType,ImpactingProject,ImpactedDepartment,ImpactDetails"
s-column="ImpactingProject" b-tableformat="TRUE" b-hashtml="FALSE"
b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1"><<</font>ImpactingProject<font size="-1">>></font>"
startspan --><%=FP_FieldVal(fp_rs,"ImpactingProject")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="39876" --></td>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ImpactDate,ImpactType,ImpactingProject,ImpactedDepartment,ImpactDetails"
s-column="ImpactedDepartment" b-tableformat="TRUE" b-hashtml="FALSE"
b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1"><<</font>ImpactedDepartment<font size="-1">>></font>"
startspan --><%=FP_FieldVal(fp_rs,"ImpactedDepartment")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="54805" --></td>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ImpactDate,ImpactType,ImpactingProject,ImpactedDepartment,ImpactDetails"
s-column="ImpactDetails" b-tableformat="TRUE" b-hashtml="FALSE"
b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1"><<</font>ImpactDetails<font size="-1">>></font>"
startspan --><%=FP_FieldVal(fp_rs,"ImpactDetails")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="34416" --></td>
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE"
b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdbrgn2.inc" i-groupsize="0"
clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00"
width="100%"><font color="#000000">This is the end of a Database Results
region.</font></td></tr>" startspan --><!--#include
file="../_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="56926" --></tbody>
</table>
<p align="left"> </p>
<p align="left"> </p>
<p align="left"><input type="submit" value="Submit" name="B1"><input
type="reset" value="Reset" name="B2"></p>
</form>
<p align="left"> </p>
<p align="left"> </p>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
</body>
</html>
but haven't gotten any closer. Just dense I guess. I also apologize in
advance for this post being so verbose.
Using FP2003 on XPPro, with an Access 2003 database with all the proper
connections, I have an .asp page that I want to use for a query. The client
wants me to use 2 javascript pop-up calendars that fill dates into text
boxes. Using the values from these text boxes, I want to search for records
between a start and end date. Here's the SQL statement:
SELECT IM_tblImpacts.ImpactDate, IM_tblImpacts.ImpactType,
IM_tblImpacts.ImpactingProject, IM_tblImpacts.ImpactedDepartment,
IM_tblImpacts.ImpactDetails
FROM IM_tblImpacts
WHERE (((IM_tblImpacts.ImpactDate) Between ::StartDate:: And ::EndDate:);
When I first open the page, I get:
Database Results Error
Description: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing
operator) in query expression '(((IM_tblImpacts.ImpactDate) Between And ))'.
Number: -2147217900 (0x80040E14)
Source: Microsoft OLE DB Provider for ODBC Drivers
One or more form fields were empty. You should provide default values for
all form fields that are used in the query.
If I choose 2 dates and click the submit button, I get "No Records
Returned", even though there are records in the date range.
Using the wizards, different forms of code, etc, I just can't get this to
work.
Page code:
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>ClientName University Training Request</title>
<script language="javascript" type="text/javascript"
src="datetimepicker.js"></script>
</head>
<body>
<div align="center">
<table style= border="0" width="604" id="table1">
<tr>
<td>
<div style="border-style: ridge">
<p style="margin-top: 0; margin-bottom: 0" align="center">
<img border="0" src="images/ClientName.bmp" width="593" height="81"></p>
</div>
<div align="center">
<table border="0" width="598" id="table2">
<tr>
<td valign="top">
<p align="center"><b><font face="Tahoma" size="4" color="#000080">
Query Test</font></b></p>
<p align="left"> </p>
<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" U-File="../_private/form_results.csv"
S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
<p align="left"><b><font face="Tahoma" color="#000080">Start Date: </font>
<input id="start" type="text" size="18" name="StartDate"><a
href="javascript:NewCal('start','MMddyyyy')"><img src="cal.gif" width="16"
height="16" border="0" alt="Pick a date"></a><br>
<font face="Tahoma" color="#000080"> End Date: </font>
<input id="end" type="text" size="18" name="EndDate"><a
href="javascript:NewCal('end','MMddyyyy')"><img src="cal.gif" width="16"
height="16" border="0" alt="Pick a date"></a></b></p>
<table width="100%">
<thead>
<tr>
<th ALIGN="LEFT"><b>ImpactDate</b></th>
<th ALIGN="LEFT"><b>ImpactType</b></th>
<th ALIGN="LEFT"><b>ImpactingProject</b></th>
<th ALIGN="LEFT"><b>ImpactedDepartment</b></th>
<th ALIGN="LEFT"><b>ImpactDetails</b></th>
</tr>
</thead>
<tbody>
<!--webbot bot="DatabaseRegionStart"
s-columnnames="ImpactDate,ImpactType,ImpactingProject,ImpactedDepartment,ImpactDetails"
s-columntypes="135,202,202,202,203" s-dataconnection="X1"
b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice s-menuvalue
b-tableborder="FALSE" b-tableexpand="TRUE" b-tableheader="TRUE"
b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0"
b-makeform="FALSE" s-recordsource
s-displaycolumns="ImpactDate,ImpactType,ImpactingProject,ImpactedDepartment,ImpactDetails"
s-criteria s-order s-sql="SELECT IM_tblImpacts.ImpactDate,
IM_tblImpacts.ImpactType, IM_tblImpacts.ImpactingProject,
IM_tblImpacts.ImpactedDepartment, IM_tblImpacts.ImpactDetails<br>FROM
IM_tblImpacts<br>WHERE (((IM_tblImpacts.ImpactDate) Between ::StartDate:: And
::EndDate:);" b-procedure="FALSE" clientside suggestedext="asp"
s-defaultfields="StartDate=&EndDate=" s-norecordsfound="No records returned."
i-maxrecords="256" 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" width="100%"><font color="#000000">This is the start of a
Database Results region.</font></td></tr>" startspan --><!--#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 IM_tblImpacts.ImpactDate, IM_tblImpacts.ImpactType,
IM_tblImpacts.ImpactingProject, IM_tblImpacts.ImpactedDepartment,
IM_tblImpacts.ImpactDetails FROM IM_tblImpacts WHERE
(((IM_tblImpacts.ImpactDate) Between ::StartDate:: And ::EndDate:);"
fp_sDefault="StartDate=&EndDate="
fp_sNoRecords="<tr><td colspan=5 align=""LEFT"" width=""100%"">No records
returned.</td></tr>"
fp_sDataConn="X1"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ImpactDate=135&ImpactType=202&ImpactingProject=202&ImpactedDepartment=202&ImpactDetails=203&"
fp_iDisplayCols=5
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="16048" --><tr>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ImpactDate,ImpactType,ImpactingProject,ImpactedDepartment,ImpactDetails"
s-column="ImpactDate" b-tableformat="TRUE" b-hashtml="FALSE"
b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1"><<</font>ImpactDate<font size="-1">>></font>" startspan
--><%=FP_FieldVal(fp_rs,"ImpactDate")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="28699" --></td>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ImpactDate,ImpactType,ImpactingProject,ImpactedDepartment,ImpactDetails"
s-column="ImpactType" b-tableformat="TRUE" b-hashtml="FALSE"
b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1"><<</font>ImpactType<font size="-1">>></font>" startspan
--><%=FP_FieldVal(fp_rs,"ImpactType")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="29467" --></td>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ImpactDate,ImpactType,ImpactingProject,ImpactedDepartment,ImpactDetails"
s-column="ImpactingProject" b-tableformat="TRUE" b-hashtml="FALSE"
b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1"><<</font>ImpactingProject<font size="-1">>></font>"
startspan --><%=FP_FieldVal(fp_rs,"ImpactingProject")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="39876" --></td>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ImpactDate,ImpactType,ImpactingProject,ImpactedDepartment,ImpactDetails"
s-column="ImpactedDepartment" b-tableformat="TRUE" b-hashtml="FALSE"
b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1"><<</font>ImpactedDepartment<font size="-1">>></font>"
startspan --><%=FP_FieldVal(fp_rs,"ImpactedDepartment")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="54805" --></td>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ImpactDate,ImpactType,ImpactingProject,ImpactedDepartment,ImpactDetails"
s-column="ImpactDetails" b-tableformat="TRUE" b-hashtml="FALSE"
b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1"><<</font>ImpactDetails<font size="-1">>></font>"
startspan --><%=FP_FieldVal(fp_rs,"ImpactDetails")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="34416" --></td>
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE"
b-menuformat="FALSE" u-dbrgn2="../_fpclass/fpdbrgn2.inc" i-groupsize="0"
clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00"
width="100%"><font color="#000000">This is the end of a Database Results
region.</font></td></tr>" startspan --><!--#include
file="../_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="56926" --></tbody>
</table>
<p align="left"> </p>
<p align="left"> </p>
<p align="left"><input type="submit" value="Submit" name="B1"><input
type="reset" value="Reset" name="B2"></p>
</form>
<p align="left"> </p>
<p align="left"> </p>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
</body>
</html>