SuperCyber
Programmer
After driving myself crazy I have come up with the code below to put a recordset into an array. It produces the required result but I know that there has got to be an easier way to do this. Any help is very appreciated.
Brian
Function FncEmpList()
Dim rs
Set cmdListEmp = Server.CreateObject("ADODB.Command"
With cmdListEmp
.ActiveConnection = connAPS
.CommandText = "sproc_CalListEmp"
.CommandType = adCmdStoredProc
Set rs = .Execute
End With
Set cmdListEmp = nothing
Do While NOT rs.EOF
FncEmpList = FncEmpList & rs("empLastName" & "," ' Return the data as an Array
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
End Function
Dim i,empID,empName,aryParsed,strItm
aryParsed = Split(FncEmpList, ","
For i = 0 to Ubound(aryParsed)-1
strItm = aryParsed(i)
Response.Write "strItm = <B>" & strItm & "</B><BR>"
Next
Brian
Function FncEmpList()
Dim rs
Set cmdListEmp = Server.CreateObject("ADODB.Command"
With cmdListEmp
.ActiveConnection = connAPS
.CommandText = "sproc_CalListEmp"
.CommandType = adCmdStoredProc
Set rs = .Execute
End With
Set cmdListEmp = nothing
Do While NOT rs.EOF
FncEmpList = FncEmpList & rs("empLastName" & "," ' Return the data as an Array
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
End Function
Dim i,empID,empName,aryParsed,strItm
aryParsed = Split(FncEmpList, ","
For i = 0 to Ubound(aryParsed)-1
strItm = aryParsed(i)
Response.Write "strItm = <B>" & strItm & "</B><BR>"
Next