Link to home
Start Free TrialLog in
Avatar of VBMAD
VBMAD

asked on

MS Flex Grid -Unable to allocate memory

When i load 15,000 rows of 54 columns to MS flexgrid, It give me an error message "Unable to allocate memory for flexgrid" - Runtime Error "30006".

My Computer Has 32 MB RAM and 4 GB of free HDD space.

How to solve this?
Avatar of wsh2
wsh2

I HAVE to ask this.. who in the heck is going to read 15,000 Rows or has a microscope to find the scrolling thumb? Very respectfully, I suggest you may want to reconsider your application design here.. <smile>.

Nevertheless, your problem is this.. you are NOT really running out of memory as you think of it. The fact of the matter is you have run out of System Resources.. <groan>.

Unfortunately on Win9x platforms.. System Resources are limited to 64k.. a problem that has haunted developers ever since Windows 3. System Resources are used for such things as Pens, Brushes, Fonts and other necessary thingz to draw a Window on the screen. As you know.. with a Flexgrid.. you can have any kind of formatting you want within each cell.. however in doing so.. a little bit of System Resources is taken for each cell in doing so.. and in this case.. your System Resources got maxed out.. <sigh>.

The only way around this is to reduce the number of graphics needed by the application.
Sounds to me like you are very short on memory.  

The first thing would be to bump the memory to 128 mb minimum.  

Next, you are loading a lot of columns (fields) and it would be quicker on the load and quicker on the interaction with the grid if you greatly reduced the number of rows.  Say, 4-6 fields/columns.

What works for me is to load the record key into column 0 and set the .colwidth(0) = 0 so that the key column does not display on the form.  Then load several other columns to show the user what they are looking for, i.e. name, address, etc.  When the user selects a row, then you use a stored procedure (if possible) to read and display/calc the rest of the fields.

Best of luck
Hi!

Error 30006 is for the Hierarchical FlexGrid.

so is it the ADO HFlexGrid or the DAO FlexGrid

Matti
Avatar of VBMAD

ASKER

what is the limitation for flexgrid cells?

is there any?
ASKER CERTIFIED SOLUTION
Avatar of wsh2
wsh2

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
Avatar of VBMAD

ASKER

Thanks, Wsh2