FP2003 SQL ignoring values passed through hyperlink

I

Ian

I wonder if anyone can help with a minor issue I am having with FP2003 and
the DBRW. I have a DBR on an ASP page that takes a value generated in a
previous page and displays records based on the variables passed through a
hyperlink. The DBR uses the following code:

SELECT DISTINCTROW Dial.Date, Sum(Dial.Cost) AS [Sum Of Cost], Count(*) AS
[Count Of Dial] FROM Dial WHERE (((Format$([Dial].[Date],'mmmm
yyyy'))="::MONTHYEAR::")) GROUP BY Dial.Date,
Year([Dial].[Date])*12+DatePart('m',[Dial].[Date])-1;

The value for the variable MONTHYEAR is normally in the format: APRIL 2005.
When I hyperlink to the page the value is passed through, I have confirmed
that the MONTHYEAR field has been populated by displaying the value via a VB
script. The DBR returns the following error:

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.

I've followed the instructions in the above article but it does not seem to
make any difference and the DatabaseRegionStart looks OK:

<!--webbot bot="DatabaseRegionStart" endspan i-checksum="56191" --><tr>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="Date,Sum_Of_Cost,Count_Of_Dial" s-column="Date"
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;Date&lt;font
size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
startspan --><%=FP_FieldVal(fp_rs,"Date")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="3267" --></td>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="Date,Sum_Of_Cost,Count_Of_Dial" s-column="Sum_Of_Cost"
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;Sum_Of_Cost&lt;font
size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
startspan --><%=FP_FieldVal(fp_rs,"Sum_Of_Cost")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="31984" --></td>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="Date,Sum_Of_Cost,Count_Of_Dial" s-column="Count_Of_Dial"
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;Count_Of_Dial&lt;font
size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
startspan --><%=FP_FieldVal(fp_rs,"Count_Of_Dial")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="29321" --></td>
</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; 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="56926" --></tbody>

The problem seems to be with the fact that the DBR ignores the
passed-through value and reports a blank value. I have tested the script in
Access and it works fine.....Any ideas?

Thanks

Ian
 
I

Ian

I've done a little bit more testing and changed from the DBRW to
hand-written code using. I am still unable to send a value through
::MONTHYEAR:: but if I replace this with a value, i.e. APRIL 2005 the code
works fine. I can confirm that MONTHYEAR does contain the correct value as
I use the value from MONTHYEAR in another part of the form and it displays
APRIL 2005 OK. Any body have any ideas? Also is there a way to send a VB
value through the SQL statement instead of the hyperlink veriable?

New code is:

<%Response.Buffer = True
Response.Expires = 0
Response.ExpiresAbsolute = now() -1
Response.CacheControl = "no-cache"
DSN = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" &
("\\server$\Mileage.mdb") & ";"
Set OBJdbConnection = Server.CreateObject("ADODB.Connection")
OBJdbConnection.Open(DSN)
Set SQLStmt = Server.CreateObject("ADODB.Command")
Set RS = Server.CreateObject ("ADODB.Recordset")
SQLStmt.CommandText = " SELECT DISTINCTROW Dial.Date, Dial.Cost,
Dial.Mileage FROM Dial WHERE (((Format$([Dial].[Date],'mmmm
yyyy'))='::MONTHYEAR::')) GROUP BY Dial.Date, Dial.Cost, Dial.Mileage; "
SQLStmt.CommandType = 1
Set SQLStmt.ActiveConnection = OBJdbConnection
RS.Open SQLStmt
do while not RS.EOF %>

<tr>
<td><%=RS("Date")%>&nbsp;</td>
<td><%=RS("Cost")%>&nbsp;</td>
<td><%=RS("Mileage")%>&nbsp;</td>
</tr>
<%
RS.movenext
loop
OBJdbConnection.Close
Set OBJdbConnection = Nothing
%>


Ian said:
I wonder if anyone can help with a minor issue I am having with FP2003 and
the DBRW. I have a DBR on an ASP page that takes a value generated in a
previous page and displays records based on the variables passed through a
hyperlink. The DBR uses the following code:

SELECT DISTINCTROW Dial.Date, Sum(Dial.Cost) AS [Sum Of Cost], Count(*) AS
[Count Of Dial] FROM Dial WHERE (((Format$([Dial].[Date],'mmmm
yyyy'))="::MONTHYEAR::")) GROUP BY Dial.Date,
Year([Dial].[Date])*12+DatePart('m',[Dial].[Date])-1;

The value for the variable MONTHYEAR is normally in the format: APRIL
2005. When I hyperlink to the page the value is passed through, I have
confirmed that the MONTHYEAR field has been populated by displaying the
value via a VB script. The DBR returns the following error:

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.

I've followed the instructions in the above article but it does not seem
to make any difference and the DatabaseRegionStart looks OK:

<!--webbot bot="DatabaseRegionStart" endspan i-checksum="56191" --><tr>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="Date,Sum_Of_Cost,Count_Of_Dial" s-column="Date"
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;Date&lt;font
size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
startspan --><%=FP_FieldVal(fp_rs,"Date")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="3267" --></td>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="Date,Sum_Of_Cost,Count_Of_Dial" s-column="Sum_Of_Cost"
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;Sum_Of_Cost&lt;font
size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
startspan --><%=FP_FieldVal(fp_rs,"Sum_Of_Cost")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="31984" --></td>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="Date,Sum_Of_Cost,Count_Of_Dial" s-column="Count_Of_Dial"
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;Count_Of_Dial&lt;font
size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
startspan --><%=FP_FieldVal(fp_rs,"Count_Of_Dial")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="29321" --></td>
</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; 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="56926" --></tbody>

The problem seems to be with the fact that the DBR ignores the
passed-through value and reports a blank value. I have tested the script
in Access and it works fine.....Any ideas?

Thanks

Ian
 
I

Ian

Resolved my issue, built the SQL string outside of the code and it works
great.... If anybody is interested.


Ian said:
I wonder if anyone can help with a minor issue I am having with FP2003 and
the DBRW. I have a DBR on an ASP page that takes a value generated in a
previous page and displays records based on the variables passed through a
hyperlink. The DBR uses the following code:

SELECT DISTINCTROW Dial.Date, Sum(Dial.Cost) AS [Sum Of Cost], Count(*) AS
[Count Of Dial] FROM Dial WHERE (((Format$([Dial].[Date],'mmmm
yyyy'))="::MONTHYEAR::")) GROUP BY Dial.Date,
Year([Dial].[Date])*12+DatePart('m',[Dial].[Date])-1;

The value for the variable MONTHYEAR is normally in the format: APRIL
2005. When I hyperlink to the page the value is passed through, I have
confirmed that the MONTHYEAR field has been populated by displaying the
value via a VB script. The DBR returns the following error:

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.

I've followed the instructions in the above article but it does not seem
to make any difference and the DatabaseRegionStart looks OK:

<!--webbot bot="DatabaseRegionStart" endspan i-checksum="56191" --><tr>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="Date,Sum_Of_Cost,Count_Of_Dial" s-column="Date"
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;Date&lt;font
size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
startspan --><%=FP_FieldVal(fp_rs,"Date")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="3267" --></td>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="Date,Sum_Of_Cost,Count_Of_Dial" s-column="Sum_Of_Cost"
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;Sum_Of_Cost&lt;font
size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
startspan --><%=FP_FieldVal(fp_rs,"Sum_Of_Cost")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="31984" --></td>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="Date,Sum_Of_Cost,Count_Of_Dial" s-column="Count_Of_Dial"
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;Count_Of_Dial&lt;font
size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;"
startspan --><%=FP_FieldVal(fp_rs,"Count_Of_Dial")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="29321" --></td>
</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; 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="56926" --></tbody>

The problem seems to be with the fact that the DBR ignores the
passed-through value and reports a blank value. I have tested the script
in Access and it works fine.....Any ideas?

Thanks

Ian
 

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