Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 3rd, 2004, 04:10 AM
Registered User
 
Join Date: Feb 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Converting recordset to an array

Hi

Trying to convert a recordset to an array, but I get a "Subscript out of range" error. Below is the code ...

<%
    'Create a recordset object instance
    Dim objRSExt
    Set objRSExt = Server.CreateObject("ADODB.Recordset")
    objRSExt.Open "SELECT * FROM FormFormats", objConn, adOpenForwardOnly

    'Write form format extensions to an array
    Dim arrExt
    arrExt = objRSExt.GetRows()

    objRSExt.Close
    Set objRSExt = Nothing
    objConn.Close
    Set objConn = Nothing

    Dim iExtLoop
    For iExtLoop = LBound(arrExt) to UBound(arrExt)
        Response.Write "<p>" & arrExt(iExtLoop) & "</p>"
    Next
%>

Any help much appreciated.
Reply With Quote
  #2 (permalink)  
Old February 3rd, 2004, 05:41 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

GetRows produces a 2D array where the first dimension is the columns and the 2nd dimension is the rows, so to read, say, the 2nd column from the first row you need arrExt(1, 0).

hth
Phil
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clone DAO Recordset into ADO Recordset kamrans74 VB How-To 0 March 6th, 2007 11:57 AM
Converting a String to a Byte array BrianWren Pro Visual Basic 2005 2 February 20th, 2007 11:03 PM
converting recordset to array? carnevil00 Access VBA 8 October 2nd, 2006 02:43 PM
Recordset into array foddie Beginning PHP 2 August 8th, 2006 08:36 AM
Recordset Into Array ~ How do I do it? phungleon Classic ASP Databases 2 May 13th, 2004 01:25 PM



All times are GMT -4. The time now is 11:51 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.