In vbscript I have a piece of code that is used many times on a page so I am putting it into a function.
The problem I am having is that this piece of code uses information from a recordset that is retrieved earlier in the script.
I want to pass the name of the recordset to the function and then use it inside the function.
My code is as follows:
Function displayData(recordsetName)
while not recordsetName.EOF
response.write recordsetName.fields(0)
recordsetName.movenext
wend
End Function
How do I use the recordsetName that is passed to the function in the function without it throwing up an error.
Thanks
The problem I am having is that this piece of code uses information from a recordset that is retrieved earlier in the script.
I want to pass the name of the recordset to the function and then use it inside the function.
My code is as follows:
Function displayData(recordsetName)
while not recordsetName.EOF
response.write recordsetName.fields(0)
recordsetName.movenext
wend
End Function
How do I use the recordsetName that is passed to the function in the function without it throwing up an error.
Thanks