'Note that this code fragment assumes a ORABFILE object as the result of a
'dynaset operation. This object could have been an OUT parameter of a PL/SQL
'procedure. For more information please refer to chapter 1: 
Dim MySession As OraSession
Dim OraDb As OraDatabase

Dim OraDyn As OraDynaset, OraMusic As OraBfile, amount_read%, chunksize%, chunk

Set MySession = CreateObject("OracleInProcServer.XOraSession")
Set OraDb = MySession.OpenDatabase("exampledb", "scott/tiger", 0&)

chunk_size = 32767
Set OraDyn = OraDb.CreateDynaset("select * from Multimedia_tab", ORADYN_DEFAULT)
Set OraMusic = OraDyn.Fields("Music").Value
OraMusic.PollingAmount = OraMusic.Size 'Read entire BFILE contents
OraMusic.offset = 255 'Read from the 255th position
'Open the Bfile for reading: 
OraMusic.Open
amount_read = OraMusic.Read(chunk, chunk_size) 'chunk returned is a variant of type byte array
 If amount_read <> chunk_size Then
    'Do error processing
 Else
     'Process the data
 End If
