| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> RDO Appendchunk - Out of memory error
I am currently working on a VB 5 project which involves writing
huge image files to the database. I am using RDO's appendchunk
method to write to a long raw field in the oracle database.
I am getting an "Out of memory" error (error code = 40007) in a loop that's shown in the code below. The error occurs only with the image files greater than 15 mb.
Please help...
Your input will be greatly appreciated.
J Chai
Environment:
Development Tool: VB 5 Enterprise edition (Service pack 3).
Database: Oracle 7 Release 7.3.3.0.0 ODBC Driver: Oracle 7 32 bit ODBC Driver 2.5.3.1.0B RDO: msrdo20.dll (5.01.4319) CPU: Pentium II 300mhz RAM: 64mb (and other system with 128mb) OS: Windows 95 (4.00.950 B)
Note:
The size of the image file is 30 mb (30,340,122).
CHUNK_SIZE = 60,000
The error always occurs at the point where iLoop = 252, appending around
15mb worth of data. This error also occurs at the same point in the
other
system with twice the memory (64mb and 128mb).
VB Source code:
'----------------------------------------------------------------------
Dim rsRss As rdoResultset
Dim bytChunk() As Byte
Dim iDataFile As Integer
Dim lFileSize As Long
Dim lFragment As Long
Dim iLoop As Integer
Dim iNumChunks As Integer
''''''''''''''''
' some code here
''''''''''''''''
Set rsRss = cnX.OpenResultSet(sSQL, rdOpenKeyset,
rdConcurValues, rdExecDirect)
If rsRss.Updatable = False Then
GoTo XH 'exit
End If
rsRss.Edit
rsRss("Document_ID") = p_lDocId
iDataFile = 1
'open the local image file, sImageFilePath
Open sImageFilePath For Binary Access Read As iDataFile
lFileSize = LOF(iDataFile)
If lFileSize = 0 Then
Close iDataFile
GoTo XH
End If
iNumChunks = lFileSize \ CHUNK_SIZE
lFragment = lFileSize Mod CHUNK_SIZE
rsRss("ImageFld").AppendChunk Null
ReDim bytChunk(lFragment)
Get iDataFile, , bytChunk()
rsRss("ImageFld").AppendChunk bytChunk()
ReDim bytChunk(CHUNK_SIZE)
For iLoop = 1 To iNumChunks
Get iDataFile, , bytChunk()
rsRss("ImageFld").AppendChunk bytChunk() ' <---- error
occurs here
Next
rsRss.Update
Close iDataFile
XH:
'Exit handling goes here
'-----------------------------------------------------------------------
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Tue Jul 20 1999 - 08:33:07 CDT
![]() |
![]() |