
optional parameters in COM object methods
Does anyone know how to cope with optional parameters in JS.
I am using SQL2000 ADO2.6 XML in an ASP. The following line works OK in
VBScript adoCmd.Execute , , adExecuteStream
all parameters here are optional, but we need to set the third one to do the new
XML dialect query with output to a stream. In JS I tried things like:
adoCmd.Execute( , , adExecuteStream);
adoCmd.Execute(null ,null , adExecuteStream);
The first is a syntax error, the second causes ADODB to complain.
If I set the second parameter with an empty array of parameters it tells me that
this is inconsistent with the setting of the third parameter. In the end I
created a small VBSCRIPT sub and called it from JS and this works . . .
<SCRIPT RUNAT=server language="vbscript">
Sub ExecStream()
adoCmd.Execute , , adExecuteStream
End Sub
</SCRIPT>
My ASP starts as follows:
<OBJECT RUNAT=server ID=adoCmd PROGID="ADODB.Command.2.6"></OBJECT>
. . .
<!--METADATA TYPE="TypeLib" FILE="C:\WINNT\System32\msxml3.dll"-->
. . .
Thus the adoCmd object is visible in both script blocks.
If anyone knows how to do this in JS, I would be very interested.