How do I pass an array byRef from an ASP Page to a VB.Net function
Posted on 2005-05-13
I have an asp page that needs to call a VB.NET function. I want to pass in an array, use the VB.net function to populate this array and then use the data back in the asp page.
My code looks like this:
Public Function getTasks(ByRef Contacts() As VariantType, ByVal sfUser As String, ByVal sfPW As String) As Integer
---code to populate the array, return an integer value that is the number of entries in the array.
ASP Page Code:
NumberOfContacts = AutoResponse.GetTasks(Contacts(), sfUserName, sfPW)
This is the error I'm getting when I run:
Microsoft VBScript runtime error '800a0009'
Subscript out of range
When I change the function call to remove the parenthesis after the name of the array, I get this error message.
Microsoft VBScript runtime error '800a0005'
Invalid procedure call or argument: 'GetTasks'
I also tried coding the VB.NET function to declare the Contacts As String and I still get an error.
I pretty new at VB.NET so all the help you can give me will be very appreciated.