0 Replies Latest reply on May 15, 2003 6:48 AM by 394698

    Facing Problem reading Long Raw field

      Hi All,

      I am facing problem while reading data from a Long Raw
      column using Oracle Object for OLE

      Problem description:

      There is a column in the database table which stores
      the files into a column of datatype LONGRAW. I have
      read the file from
      the column and construct the bytes read as the file.
      To do this I am using oracle object for ole ver
      (and Oracle database Server verion is 8.1.5). I used
      GetChunk method to construct file; below is the code

      Public Sub PutDataFromFieldToFile(f As Object, Fname$)

      'f is the field object, Fname is name of the
      file to construct
      Dim fnum%, i As Long
      Dim CurSize As Integer, CurChunk As String
      Const ChunkSize = 32000

      fnum = FreeFile
      Open Fname For Binary Access Write As fnum
      i = 0
      'Loop through all of the chunks
      'Oracle does not return the size of columns >
      'We should loop until the length of our block is
      'less than we asked for.
      CurChunk = f.GetChunk(i * ChunkSize,
      CurSize = Len(CurChunk) 'Get the length of the
      current chunk.
      Put #fnum, , CurChunk 'Write chunk to file.
      i = i + 1
      Loop Until CurSize > ChunkSize
      Close fnum
      End Sub


      Above code is fetching the bytes from the specified
      field, but if we view the file, for example pdf, is
      not getting opened in its associated viewer and
      getting an error saying the file got corrupted.

      Please advice me how to solve the problem or let me
      know if there are any patches to be installed either
      at client side or server side.

      Further, the same code was working fine with OO4O But we dont want to go back to OO4O version.

      The database Server verion we are using is 8.1.5 and
      it is installed on Solaris OS.

      Please let me know if u want any further information.

      Thanks in advance