Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple SP Error passing Date to SP 1

Status
Not open for further replies.

JordanR

Technical User
Oct 3, 2002
182
US
I get the following error when trying to pass a date to a stored procedure:

Microsoft OLE DB Provider for SQL Server error '80040e14'

Line 1: Incorrect syntax near '/'.

/testing/storedproc2.asp, line 16

My call to the procedure is:

getdate = "06/09/2006"
SET rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Exec getexpiring " & getdate, con
response.write rs("domain_sld")

my stored procedure is:

CREATE proc getexpiring
@thedate datetime
AS
SELECT * FROM mytable WHERE expireationdate <= @thedate
GO


Can anyone help me with this?

 
Try using the following:

rs.Open "Exec getexpiring @thedate='" & getdate & "'", con

GT Interactive
-----------------------------
Components/Tools/Forums/Software/Web Services
 
That makes a whole lot of sense, to put double quotes there.
Thanks alot. It worked.
 
Gorkem,
I am a newbie at sp,
can you direct me to a place where I can learn more about SP with ASP? Some place where rocket scientist aren't teaching?
 
Well there really isn't much to learn about using SP with ASP..

HOWEVER...

What you will want to read up on is ADODB.Command and using the PARAMETERS function.. once you understand how to use this, SP's are a snap! ;o)

Cheers,

G.

P.S.

Thanks for the star!



GT Interactive
-----------------------------
Components/Tools/Forums/Software/Web Services
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top