Forums

This topic is locked

Parameter Query Using Dreamweaver Code

Posted 01 Jun 2004 14:49:45
1
has voted
01 Jun 2004 14:49:45 Darragh Kitt posted:
Hi,
I need to pass two dates as parameters to this query(in an Access Database), Where should I pass them? Or is it possible.

Many thanks.
<%
Dim RS_Spread_Data
Dim RS_Spread_Data_numRows

Set RS_Spread_Data = Server.CreateObject("ADODB.Recordset"
RS_Spread_Data.ActiveConnection = MM_conn_Cross_Reference_STRING
RS_Spread_Data.Source = "SELECT * FROM QRY_TEST"
RS_Spread_Data.CursorType = 0
RS_Spread_Data.CursorLocation = 2
RS_Spread_Data.LockType = 1
RS_Spread_Data.Open()

RS_Spread_Data_numRows = 0
%>

Replies

Replied 21 Jun 2004 13:41:04
21 Jun 2004 13:41:04 Simon Martin replied:
Build your recordset using the Advanced option.

SELECT *
FROM qry_test
WHERE date1 = varDate1 AND date2 = varDate2

then in the Variables section click the + button and add those 2 variables, named varDate1 and varDate2 - a default value of 1 (or something) and the Run-time Value from your page e.g. request("date1"

HTH

Simon

Reply to this topic