Skip to content

Instantly share code, notes, and snippets.

@facebookegypt
Created March 24, 2013 22:40
Show Gist options
  • Save facebookegypt/5233900 to your computer and use it in GitHub Desktop.
Save facebookegypt/5233900 to your computer and use it in GitHub Desktop.
Private Sub RetrieveBlob()
'The BLOB Method
StrTempPic = App.Path & "\Temp.jpg"
If Len(Dir(StrTempPic)) > 0 Then
Kill StrTempPic
End If
'Open the temporary file to save the BLOB to
nHand = FreeFile
Open StrTempPic For Binary As #nHand
'Read the binary data into the byte variable array
lngImgSiz = RS("PhotoBLOB").ActualSize
Do While lngOffset < lngImgSiz
Chunk() = RS("PhotoBLOB").GetChunk(conChunkSize)
Put #nHand, , Chunk()
lngOffset = lngOffset + conChunkSize
Loop
Close #nHand
'After loading the image, get rid of the temporary file
Picture1.Picture = LoadPicture(StrTempPic)
Kill StrTempPic
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment