Click to See Complete Forum and Search --> : Function that returns an array


SubZane
05-18-2003, 09:10 AM
I have this function that returns an array:

function ResultSetToArray(rs)
Dim i
dim arr()
redim preserve arr(rs.RecordCount)
for i=0 to rs.RecordCount-1
arr(i) = rs(0).value
rs.movenext
next
ResultSetToArray = arr
end function

but I get "Type Mismatch" errors, how should I write to make it work?

dim myarray()
myarray = ResultSetToArray(RSa) // doesn't work

SubZane
05-18-2003, 10:06 AM
thanks! works much better