Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

saving/retrieving images in vb using access database

Status
Not open for further replies.

mariabenita

Programmer
Jun 18, 2001
13
0
0
SG
already tried using appendchunk/getchunk I don't know if my coding was correct. see code used below...

Function CopyLargeField(Source As Long, _
fldDestination As Field)

' Set size of chunk in bytes.
Const conChunkSize = 10000

Dim lngOffset As Long
Dim lngTotalSize As Long
Dim strChunk As String

' Copy the photo from one Recordset to the other in 32K
' chunks until the entire field is copied.
lngTotalSize = Source
Do While lngOffset < lngTotalSize
'strChunk = fldDestination.GetChunk(lngOffset, conChunkSize)
If lngTotalSize > conChunkSize Then
strChunk = CStr(conChunkSize)
lngOffset = lngOffset + conChunkSize
Else
strChunk = CStr(lngTotalSize)
lngOffset = lngTotalSize
End If
fldDestination.AppendChunk strChunk
lngOffset = lngOffset + conChunkSize
Loop

End Function


I tried retrieving the saved data but it wont load into the imagebox.
 
What you have done is fine but ...

How did you get the image into the field to start with and how did you retrieve it to display?

Also, what type of field is it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top