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!

appendchunk hangs

Status
Not open for further replies.

99mel

Programmer
Oct 18, 1999
379
GB
I'm trying to insert a pdf into a BLOB field into an oracle table. However when i run the [recordset].update it just hangs.

Doesn't add the the record to the table either.

Any one used appendchunks with BLOB fields in oracle?

any adive appreciated!
 
Here is a snippet of code from my app where I did it. I hope it helps.



Dim success As Boolean
Const ChunkSize = 512000
Dim BlobData() As Byte
Dim DataLength As Long
Dim FileOffset As Long

record_set.Open "files_t", , adOpenStatic, adLockOptimistic, adCmdTable

'open image file
Open "filename" For Binary Access Read As #1

' add a new record to insert immage into
record_set.AddNew

DataLength = LOF(1)

' read and store image
FileOffset = 1

Do
If FileOffset + ChunkSize <= DataLength Then
ReDim BlobData(ChunkSize)
Else
ReDim BlobData(DataLength - FileOffset + 1)
End If

Get #1, FileOffset, BlobData()
record_set.Fields(columns(0)).AppendChunk BlobData()

FileOffset = FileOffset + ChunkSize
Loop While FileOffset < DataLength

Close #1

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top