I am trying to execute a stored proc in access. The body of the stored proc is this ...
PARAMETERS x DateTime, y DateTime;
SELECT [TRIHOVER 19072002 18% ACCOUNTS].[COMPANY HANDELING ACCOUNT] AS [Agent Code], Count([TRIHOVER 19072002 18% ACCOUNTS].[COMPANY HANDELING ACCOUNT]) AS [Files Allocated], Sum([TRIHOVER 19072002 18% ACCOUNTS].[HAND OVER AMOUNT]) AS [Allocated Value]
FROM [TRIHOVER 19072002 18% ACCOUNTS]
WHERE ((([TRIHOVER 19072002 18% ACCOUNTS].DATE) Between [x] And [y]))
GROUP BY [TRIHOVER 19072002 18% ACCOUNTS].[COMPANY HANDELING ACCOUNT];
From Access, when I do not use the parameters, the query works fine. I then include the Parameters line and try the following method of opening the recordset (The shortcut is not to use parameter objects and command objects)
VB Code:
Set rs = DataEnvironment1.Connection1.Execute("qryHandoverAlloc #2000-01-01#,#2002-01-01#")
The query executes but the recordcount is zero and both EOF and BOF return true. Does anyone know what I am doing wrong or why this problem happens?? PLEEEEZ. I will love anyone to death if they can help here!!




Reply With Quote