If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Declaring Array -Urgent

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-19-02, 07:47
buddu buddu is offline
Registered User
 
Join Date: Feb 2002
Location: India
Posts: 38
Declaring Array -Urgent

HI to All
I got irretation to work with arrays.
Because While running the folling code I got the Error message Subscript OutOfRange. How do I solve this?
Code:
Dim MyArr()
  For I=1 to 5
    ReDim Preserve MyArr(I,2)
    MyArr(I,0)="No"
    MyArr(I,1)="Name"
    MyArr(I,2)="Amount"
  Next


Please Help me
__________________
-- Prasad --
Reply With Quote
  #2 (permalink)  
Old 06-19-02, 23:41
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
You can only use preserve when you are changing the last dimension - not the first. What are you trying to accomplish ?
Reply With Quote
  #3 (permalink)  
Old 06-20-02, 01:07
buddu buddu is offline
Registered User
 
Join Date: Feb 2002
Location: India
Posts: 38
for Insertig a Records

Hi
I have a routine like calulating the State,City,county,Other Taxes. It has some calculation with some other Fields.
Once the Calculation has finished I need to Insert the Records In Mytable Like // AutoNum, AcNo,State,City,County,Other //. In this case
if i insert in forLoop every state,city.... will insert diff rows Like
Code:
  AutoNo,Acno,State,0,0,0
But I need the Row to Insert All Taxes.

Because of this I am just trying to insert into Array and then inserting.
__________________
-- Prasad --
Reply With Quote
  #4 (permalink)  
Old 06-20-02, 10:58
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
I would use a programmatically created recordset and not an array. This is a recordset that is not tied to a database but rather fields you create dynamically and can manipulate like a recordset. It also gives you many more options to handle the data since methods already exist.

Let me know if you need further assistance.

Good luck.
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On