For Programmers: Free Programming Magazines  


Home > Archive > ASP > December 2004 > adDate parameter to stored proc.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author adDate parameter to stored proc.
Agoston Bejo

2004-12-30, 8:55 am

Hi!
I am trying to pass a VBScript Date variable as value to an ADO adDate
parameter of a stored procedure (which runs in an SQL Server).
If I add the parameter like this:

oCmd.Parameters.Append oCmd.CreateParameter( "@p_Date", adDate,
adParamInput, , dParam)

where oCmd is of type ADODB.Command and dParam is a VBScript variable of
type Date
then when trying to execute the stored procedure I get the following error:

Optional feature not implemented

I was able to get round this by passing a string value in an adVarChar
parameter, but it would be easier and more readable with adDate and
Date-type variables. Is this latter possible?

Thx,
Agoston


Bob Barrows [MVP]

2004-12-30, 8:55 am

Agoston Bejo wrote:
> Hi!
> I am trying to pass a VBScript Date variable as value to an ADO adDate
> parameter of a stored procedure (which runs in an SQL Server).
> If I add the parameter like this:
>
> oCmd.Parameters.Append oCmd.CreateParameter( "@p_Date", adDate,
> adParamInput, , dParam)
>
> where oCmd is of type ADODB.Command and dParam is a VBScript variable
> of type Date
> then when trying to execute the stored procedure I get the following
> error:
>
> Optional feature not implemented
>
> I was able to get round this by passing a string value in an adVarChar
> parameter, but it would be easier and more readable with adDate and
> Date-type variables. Is this latter possible?
>


You need to use adDBTimestamp, not adDate.

You might want to try out my stored procedure code generator available at
http://www.thrasherwebdesign.com/in....asp&c=&a=clear

If your procedure has no output parameters, and you are not interested in
retrieving the return parameter, you may want to consider using the
stored-procedure-as-connection-method technique instead of the explicit
Command object:

http://tinyurl.com/jyy0

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com