adDate parameter to stored proc.

A

Agoston Bejo

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
 
B

Bob Barrows [MVP]

Agoston said:
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/index.asp?pi=links&hp=links.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
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top