Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this messageAgoston 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"
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.