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!

GetChunk/AppendChunk

Status
Not open for further replies.

aidenryan

Programmer
May 18, 2001
14
0
0
CA
I've been attempting to run the example code from the address listed below. However, when the program reaches the line -

BlobToFile rs!Photo, "c:\photo1.dat", rs!Photo.ActualSize, 16384

- it displays an error telling me that
WriteFromBinary is not an optional argument.

If anyone is familiar with this code sample, I would appreciate some help.

 
DataFile = 1
If FileName <> &quot;&quot; Then
Open FileName For Binary Access Read As DataFile
Fl = LOF(DataFile)
If Fl = 0 Then
Close DataFile
Exit Sub
End If
Chunks = Fl \ ChunkSize
Fragment = Fl Mod ChunkSize
ReDim Chunk(Fragment)
Get DataFile, , Chunk()
!foto.AppendChunk Chunk()
ReDim Chunk(ChunkSize)
For I = 1 To Chunks
Get DataFile, , Chunk()
!foto.AppendChunk Chunk()
Next I Eric De Decker
vbg.be@vbgroup.nl

 
Or Write :

DataFile = 1
Open FotoTemp For Binary Access Write As DataFile
lngTotalSize = perset!foto.FieldSize
Chunks = lngTotalSize \ ChunkSize
Fragment = lngTotalSize Mod ChunkSize
ReDim Chunk(ChunkSize)
Chunk() = perset!foto.GetChunk(lngOffset, ChunkSize)
Put DataFile, , Chunk()
lngOffset = lngOffset + ChunkSize

Do While lngOffset < lngTotalSize
Chunk() = perset!foto.GetChunk(lngOffset, ChunkSize)
Put DataFile, , Chunk()
lngOffset = lngOffset + ChunkSize
Loop

Close DataFile Eric De Decker
vbg.be@vbgroup.nl

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top