Re: [VB Rich Client 5] - Getting out of memory error when opening RS
Based on the size of your table you need also at least 600MB for the created recordset plus the amount of overhead of getting the data from the database -> interface -> recordset.
Re: [VB Rich Client 5] - Getting out of memory error when opening RS
How many rows are we talking about? Do you really need to get them all, or can you get a chunk, process them, get the next chunk, process them, etc...?
Or do you even need all the images at one time? How about SELECTing just the non-BLOB fields, do you processing, and then fetch the BLOBs separately as needed?
Another option might be to make your executable LARGEADDRESSAWARE (search this forum and/or Google for instructions in how to do this). It might buy you enough free memory if your database isn't going to continue to grow in size considerably.
Lastly - do the images need to be stored in the database? You could keep them on the file system, and then just store a path to the appropriate image in the database to reduce the size of the recordset.
Re: [VB Rich Client 5] - Getting out of memory error when opening RS
Originally Posted by yogiyang
Thanks everyone.
I have managed to solve the problem.
What I have done is load all the required rows without the Photo filed in RS and then load single photo separate as needed.
Ah - good it's solved already...
Maybe a note with regards to the cRecordsets, how they are retrieved,
based on the underlying Select-String...
Other than with ADO-Rs, the RC5-implementation supports only a clientside
cursor, meaning you can rely on, that after the Rs is returned to you from
the Select, that "all Records are there" (stored inside the Rs, as a copy in memory).
And that requires appropriately sized allocations in the Client-Process - and a
developer is good advised, to use "properly placed Where-Clauses and Field-Lists"
(at least, when working against heavy Tables).
ADO (when using serverside Cursors) allows more lightweight Looping over
the Records in a retrieved Rs, but in this mode offers no information about
the amount of returned Records, until "fully looped through".
As said, in cRecordsets this mode is not supported - but page-wise looping (when
needed) is easy to accomplish with either appropriate Where- and OrderBy-Clauses,
or by entirely relying on SQLites "Limit xxx Offset yyy" construct, placed at the end
of an SQL-String: https://www.sqlite.org/lang_select.html#limitoffset