blob saving mystery

f3rDzReYeS
06-02-2004, 08:07 AM
How come there are instances wherein the jpg's blob file are saved in the Photo field and there are time's its not?


Private Sub cmdTWAIN_Click()
'create a temporary file acquired from a webcam
frmAcquireImage.Show vbModal, Me
'load the temporary file n image1
Image1.Picture = LoadPicture("c:\fjrtemp.jpg")
'append image file to database
FileToBlob Adodc1.Recordset.Fields("Photo"), "c:\fjrtemp.jpg"
End Sub


the filetoblob function came from this thread:
http://www.xtremevbtalk.com/showthread.php?t=26291

appreciate any help :D

ferdz

Dennis DVR
06-02-2004, 09:05 AM
try this


Function ProcessImage(strImageName) As Byte()
Dim IntNum As Integer
Dim ByteImage() As Byte
If (strImageName <> "") Then
IntNum = FreeFile
Open strImageName For Binary As #IntNum
ReDim ByteImage(FileLen(strImageName))
Get #IntNum, , ByteImage
Close #1
End If
ProcessImage = ByteImage
End Function

to save the image to your table

rs.Fields("myImage").AppendChunk ProcessImage("c:\fjrtemp.jpg")


But saving the image to your table will rapidly increase the size of your Database so i won't recommend using this method save the path and name of the image file as much as you can.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum