Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Collection instead of array

Status
Not open for further replies.

cainemart

Programmer
Nov 28, 2001
70
US
I have this array, which someone else designed:

Dim EPArray(1 To 9, 1 To 3, 2000 To 2003, 1 To 12, 1996 To 2003, 1 To 12, 1 To 5, 1 To 4) As Single

This array loops through millions of records and collects the info.
The problem is that it needs to be Dim even more that it already is. When we try to go further, we get an memory error message. So I started reading some stuff about collections and how they might be the answer to my problems. I can't find any good info on how to take an array like the one above and turn it into a collection.

I need help either by explaining how to go from an array to a collection or a good resource on this. How to declare, how it would collect all of the info above and keep it together, really just any help or advice you might have.

Using Access 2000.

Thanks
 
First off your array is storing 2,488,320 different values of type single

Do you need ALL of those dimensions ?

Are there cases when a value in one dimension means that only a limited range ( or none ) are valid in another dimension ?

If this is the case you can possibly cleave the array into two smaller arrays.

If you can't then I am unable to see how collections are going to help. You have 2,488,320 singles to store. It doesn't matter how you structure them 2and a half million singles are going to take up a lot of space.
If speed is not an issue then you could store the values into a table. Access will cope with that many records quite happily and the hard disc will have the space - but it won't be a fast to manipulate as the Array.

G LS
 
For each of the records it loops through it collects all of the info in the array and this is the copy of a small array they started off with. They have it broken down into small pieces like the array I gave as an example but they want to be able to do all of the work in one pass rather than the many individual pieces. Like I said before, this was passed to me not done by me!

I didn't think that a table could handle this because when all is done it could loop through 4 mill records and collect this info. My suggestion was to use a better dB program, but......


Thanks for your help!
 
It looks like a closed (minded) system to me. Sort of the old "NIH" -Not invented Here- syndrome. If you do not have a good grasp of both the problem and (proposed) soloutions, you cannot be in the position to accept alternatives. Relational dbs can often eliminate the "loop" soloution through the use of the capability of SQL.


MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top