2

Here's the sproc:

ALTER PROC [dbo].[cms_createNoteMultipleRecID] (
  @NoteDt smalldatetime, 
  ...
  @NoteIDCSV VARCHAR(max) OUTPUT
)

And here's the VBScript:

cmd.CommandText = "cms_createNoteMultipleRecID"
cmd.Parameters.Append = cmd.CreateParameter("@RC", adInteger, adParamReturnValue)
cmd.Parameters.Append = cmd.CreateParameter("@NoteDt", adDBDate, adParamInput,, NoteDt )
...
cmd.Parameters.Append = cmd.CreateParameter("@NoteIDCSV", adLongVarWChar, adParamOutput )

Seems like adLongVarWChar works for input, as I have used it a few times. But, what's the proper way to use a varchar(max) output in VBScript? As-is, my error states: "Parameter object is improperly defined. Inconsistent or incomplete information was provided." from ADODB.

alphadogg
  • 12,762
  • 9
  • 54
  • 88
  • SQL Server does not support the adDBDate datatype. You have to correct this problem, change the datatype of the @NoteDt parameter to adDBTimeStamp. – Artemination Mar 05 '15 at 23:16

2 Answers2

4

This works:

cmd.Parameters.Append = cmd.CreateParameter("@NoteIDCSV", adBStr, adParamOutput, -1 )

Open to better ideas.

alphadogg
  • 12,762
  • 9
  • 54
  • 88
2

set the size argument to CreateParameter to -1. I think this is the syntax (can't test at the moment):

cmd.Parameters.Append = cmd.CreateParameter("@NoteIDCSV", adLongVarWChar, adParamOutput, -1 )
tenfour
  • 36,141
  • 15
  • 83
  • 142