Link to home
Start Free TrialLog in
Avatar of sciber_dude
sciber_dudeFlag for United States of America

asked on

Problem: Using GetRows()

Objective: to get the recordset into an array

Got a wierd problem with using GetRows.

<%
' Connection Strings have been set

set rs = Server.CreateObject("ADODB.recordset")
SQL = "SELECT TeamName FROM teams"
rs.Open SQL, conn

dim arrTeams
arrTeams = rs.GetRows()

response.write Ubound(arrTeams) & "<br>"
%>
returns:
0

<%
for each z in arrTeams
      response.write z & "<br>"
next
%>
returns the following:
Rockets
Knicks
Lakers
Jazz
Hawks
Clippers


How can i get the recordset into an array so that I can reference it as arrTeams(0) ... arrTeams(Ubound(arrTeams))

:) SD
ASKER CERTIFIED SOLUTION
Avatar of fritz_the_blank
fritz_the_blank
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I have two tables here--the first being the typical way that you would iterate through the recordset, the second  using the GetRows() method.

FtB
Avatar of sciber_dude

ASKER

Thanks FtB,

this was the first time i was trying the getrows method and i ran into problems. I will test this code in a few min and close this question.

Thank you,
:) SD
Thanks FtB, it works like a charm

:) SD
Glad to have helped,

FtB