I have bmps, gifs, and jpgs stored in my access 97 database. I have no problems binary writing bitmaps and gifs because I know the header point that access adds to the ole field...BM and GIF89 respectively but I can't find the jpg access header in the ole field... can anyone tell me what it is? Here is a sample of the code I'm using to binary write the correct information. You'll see what I mean by the access header..
VB Code:
  1. ExportFile Me.RecordsetClone.Fields("PictureType")
  2. Dim lngFileSize As Long, lngOffset As Long
  3. Dim strChunk As String, strBuild As String, intPos As Integer
  4.  
  5. lngOffset = 0
  6. lngFileSize = 0
  7. lngFileSize = Me.RecordsetClone.Fields("picture").FieldSize
  8.  
  9. Do While lngOffset < lngFileSize
  10.      strChunk = Me.RecordsetClone.Fields("picture").GetChunk(lngOffset, 1024)
  11.      strBuild = strBuild & strChunk
  12.      lngOffset = lngOffset + 1024
  13. Loop
  14. strBuild = StrConv(strBuild, vbUnicode)
  15. intPos = InStr(strBuild, "BM")  '<--- I need the header for a jpg file
  16.  
  17. If intPos > 0 Then
  18.      strBuild = right(strBuild, Len(strBuild) - intPos + 1)
  19. End If
  20.  
  21. Open strFilename For Binary As #1
  22. Put #1, , strBuild
  23. Close #1