Stored procedure params getting me crazy!

A

Atlas

I have built a stored procedure that has two parameters, that passes the
syntax check and recognize the two parameters (in the properties dialog, in
the parameters tab).
But something is wrong and I keep getting a dialog asking me to enter the
parameters.

here's the sp code

CREATE PROCEDURE dbUser.MySP(@DataEnd nvarchar(100), @DateStart
nvarchar(100))
AS SELECT dbo.[Details].Article
FROM dbo.[Details]
WHERE (dbo.[Details.Date <= CONVERT(DATETIME, @DateEnd,105)) AND
(dbo.[Details].Date >= CONVERT(DATETIME, @DateStart,105))
GO




and in the form's code....


Me.RecordSource = "exec MySp @DateEnd = '" & date1 & " 00:00:00'" & ",
@DateStart = '" & date2 & " 00:00:00'"

I'v also tried without the comma between the two parameters.
 
I

Igor V. Makeev

Hello, Atlas!
You wrote in message on Fri, 18 Jun 2004 13:42:59 +0200:

<skip>

A> and in the form's code....

A> Me.RecordSource = "exec MySp @DateEnd = '" & date1 & " 00:00:00'" & ",
A> @DateStart = '" & date2 & " 00:00:00'"

There are two variants; you may use either of them.

1)
Me.InputParameters = "@DateEnd nvarchar = '" & date1 & " 00:00:00'" & _
", @DateStart nvarchar = " & date2 & " 00:00:00'"
Me.RecordSource = "MySp"

2)
Me.RecordSource = "exec MySp '" & date1 & " 00:00:00'" & _
", '" & date2 & " 00:00:00'"

With best regards, Igor.
ICQ: 111469481
 

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