Dim stringIdCollection
stringIdCollection = Join( Request.Form( "id" ), "', '" ) )
Dim whereStatement
whereStatement = "WHERE id IN ('" & stringIdCollection & "');"
I get this error:
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/includes/Process.asp, line 49 stringIdCollection = Join( Request.Form( "id" ), "', '" ) ) ------------------------------------------------------------------------^
Is it even possible to use Join on a Request.Form?
I would like the output to be:
"WHERE id IN ('122', '344', '599')"
That looks like an extra parentheses on the second line that should be deleted:
EDIT: The documentation for
Request.Form
is a little bit misleading. The value returned byRequest.Form("item")
isn't really an array, but an array-like object. You can iterate through those values by using theCount
property and build your string as you iterate:The
join
function expects an array as the first parameter. In Classic ASP (VBScript) the data inRequest.Form
is always string, so impossible to have an actual array in it, you have to build the array yourself :Also notice that in Classic ASP, if you submit multiple form fields with the same names (i.e.
id
), they will get inRequest.Form
already separated by a commas.Contrary to what can be done in PHP, naming multiple form fields with square brackets [] appended at the end, ASP will not convert it as an array in Request.Form.