Details

One user reported in the forums that the application is producing Range Check errors with a big big big store.

The size of the store is reported to be:
23000 products in 1500 categories.

The OSCPMWin was not designed to handle such large store. We need to review the code for 3 things:

1) To increase the limits safely (check for memory consumption on top usage).

2) Add range checking to all operations importing data from the database. The error the user received was an exception handled directly by Delphi, the state of the data in the memory structures is unknown. The application should stop, warn the user and end any further processing.

3) Check for a way to handle those limits dinamically. Unless reviewing point 1 results in that we can move the limits up without any danger, we should look for another way to allocate memory on-demand.

Severity as "Major", because the application cannot be used.
Priority as "Medium-High", just to be on the safe side.

On a related problem, the application is raising an exception, not a friendly, recoverable error message. I suggest to check always the record count so the code doesn't go further than the array limits. Remember, no input data can be trusted unless is in full control of the application.

Max products from 32768 to 35000.
Max descriptions from 700000 to 1000000.
Max languages from 16 to 20.
Max categories from 2048 to 5000.
Max manufacturers from 2048 to 5000.
Max taxes from 128 to 150.

Modified oscpmdata.pas to increase the limits of the application. Max products from 35000 to 50000. Max descriptions from 700000 to 1000000. Max categories from 5000 to 10000. Max manufacturers from 5000 to 8000. This fixes Bug #83 (which was reopened).