Dec 23, 2002 #1 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!
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!
Jan 2, 2003 #2 garths2 Programmer Jan 15, 2002 57 US 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 Upvote 0 Downvote
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