Using pervasive SQL 2000 I have created:
CREATE PROCEDURE spINTXCT(in :UpperDate date)
RETURNS(chrItem char (20),
chrLoc char(7), chrLayer chr(3),
numStock numeric, numQtyRemn numeric,
dtApplDate date)
AS
BEGIN
SELECT INTXCT.Itemkey, INTXCT.Location,
INTXCT.Layertyp, INTXCT.Stockqty,
INTXCT.Qtyrmn, INTXCT.Apldate
FROM INTXCT
WHERE (INTXCT.Layertyp='0')
AND (INTXCT.Apldate < :UpperDate)
ORDER BY INTXCT.Itemkey, INTXCT.Apldate;
END
...
which I invoke using:
Private Sub cmdPass_Click()
Dim rsPass As New ADODB.Recordset
Dim comPass As New ADODB.Command
Dim i As Integer
On Error GoTo PassErrHand
With comPass
.ActiveConnection = cn
.Parameters = "2002-03-01"
.CommandText = "call spINTXCT()"
End With
Set rsPass = comPass.Execute()
Set rsPass.ActiveConnection = Nothing
....
which of course fails (although, of course, it runs as a query. I assume the fault is with how I am passing the parameter, but what am I doing wrong?
CREATE PROCEDURE spINTXCT(in :UpperDate date)
RETURNS(chrItem char (20),
chrLoc char(7), chrLayer chr(3),
numStock numeric, numQtyRemn numeric,
dtApplDate date)
AS
BEGIN
SELECT INTXCT.Itemkey, INTXCT.Location,
INTXCT.Layertyp, INTXCT.Stockqty,
INTXCT.Qtyrmn, INTXCT.Apldate
FROM INTXCT
WHERE (INTXCT.Layertyp='0')
AND (INTXCT.Apldate < :UpperDate)
ORDER BY INTXCT.Itemkey, INTXCT.Apldate;
END
...
which I invoke using:
Private Sub cmdPass_Click()
Dim rsPass As New ADODB.Recordset
Dim comPass As New ADODB.Command
Dim i As Integer
On Error GoTo PassErrHand
With comPass
.ActiveConnection = cn
.Parameters = "2002-03-01"
.CommandText = "call spINTXCT()"
End With
Set rsPass = comPass.Execute()
Set rsPass.ActiveConnection = Nothing
....
which of course fails (although, of course, it runs as a query. I assume the fault is with how I am passing the parameter, but what am I doing wrong?