|
-
Jun 25th, 2003, 01:21 PM
#1
Thread Starter
Hyperactive Member
Binary writing of JPG from access problem..
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
-
Jun 25th, 2003, 01:27 PM
#2
The picture isn't missing
JFIF i believe. you really only need to extract the first 10 bytes of the file.
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Jun 25th, 2003, 01:47 PM
#3
Thread Starter
Hyperactive Member
Nevermind.. I figured it out.. there is no header code for a jpg.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|