ParameterValues.add ..., ... is Ignored in Access 2003?

A

Ace Calhoon

Hello,
I'm trying to create a Data Access Page based on a parameter query in
Access 2003. I am explicitely setting the parameters in code, using:

<SCRIPT language=vbscript event=BeforeInitialBind for=MSODSC>
<!--

msgbox "DEBUG"
document.msodsc.RecordsetDefs("ParameterTest").ParameterValues.add
"[StartDate]", "6/1/2005"
document.msodsc.RecordsetDefs("ParameterTest").ParameterValues.add
"[EndDate]", "12/31/2005"

-->
</SCRIPT>

OR

<SCRIPT language=vbscript>
<!--

msgbox "DEBUG"
document.msodsc.RecordsetDefs("ParameterTest").ParameterValues.add
"[StartDate]", "6/1/2005"
document.msodsc.RecordsetDefs("ParameterTest").ParameterValues.add
"[EndDate]", "12/31/2005"

-->
</SCRIPT>

The query is:
SELECT Line, min(SumDate)
FROM AuditSummaries
WHERE [StartDate] <= AuditSummaries.SumDate AND AuditSummaries.SumDate
<= [EndDate]
GROUP BY Line;

Line and SumDate are both fields in the database.

Regardless, when I run the data access page I am still prompted to
enter the StartDate and EndDate parameters. I know the
ParameterValues.add s are being executed because of the message box...
They just don't seem to have any effect.

Does anybody have any ideas here? I'd even accept a work-around, like
manually changing the SQL in script...
 

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