We have a classic ASP that uses a VB6 COM like this:
Dim Value1
Dim Value2
Dim Value3
'Etc.
Dim VB6COM
Set VB6COM = Server.CreateObject("VB6COM")
VB6COM.GetSomeValues MyConnectionString, "TABLE_NAME", "ROW_ID = 1", _
"FIELD_NAME_1", Value1, _
"FIELD_NAME_2", Value2, _
"FIELD_NAME_3", Value3, ... Etc.
The procedure being called is like this:
Public Sub GetSomeValues(ConnectionString, TableSource, SearchCondition, ParamArray Fields())
'Code to open the database and retrieve the row goes here.
'For this example to run without a database, we use example values below.
For Index = 0 To UBound(Fields) Step 2
Fields(Index + 1) = "ExampleValue" & Index
Next
End Sub
We want to stop using the VB6COM and move this function to the ASP web site.
So the call should drop the Server.CreateObject lines and end up like this:
Dim Value1
Dim Value2
Dim Value3
'Etc.
GetSomeValues MyConnectionString, "TABLE_NAME", "ROW_ID = 1", _
"FIELD_NAME_1", Value1, _
"FIELD_NAME_2", Value2, _
"FIELD_NAME_3", Value3, ... Etc.
Problem is, VBScript does not support ParamArrays.
I know we can change the ParamArray to be an array object. But since we have to change thousands of calls, it would be better if there is a way to maintain the original call.
Any ideas?