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:
ExportFile Me.RecordsetClone.Fields("PictureType") Dim lngFileSize As Long, lngOffset As Long Dim strChunk As String, strBuild As String, intPos As Integer lngOffset = 0 lngFileSize = 0 lngFileSize = Me.RecordsetClone.Fields("picture").FieldSize Do While lngOffset < lngFileSize strChunk = Me.RecordsetClone.Fields("picture").GetChunk(lngOffset, 1024) strBuild = strBuild & strChunk lngOffset = lngOffset + 1024 Loop strBuild = StrConv(strBuild, vbUnicode) intPos = InStr(strBuild, "BM") '<--- I need the header for a jpg file If intPos > 0 Then strBuild = right(strBuild, Len(strBuild) - intPos + 1) End If Open strFilename For Binary As #1 Put #1, , strBuild Close #1




Reply With Quote