Private Function Image2Chunk(Filename As String) As Variant
On Error GoTo ProcErr
Dim Datafile As Integer
Dim FileLength As Long
Dim chunk() As Byte
    
  Datafile = FreeFile
  Open Filename For Binary Access Read As Datafile
    FileLength = LOF(Datafile)
    If FileLength = 0 Then GoTo ProcErr
    ReDim chunk(FileLength)
    Get Datafile, , chunk()
  Close Datafile
    
ProcExit:
  Image2Chunk = chunk()
  Exit FunctionProcErr:
  Image2Chunk = 0
End FunctionDim chunk() As Byte
        chunk() = Image2Chunk(tmpFile1)
        .Fields("tp1").AppendChunk chunk()
        .UpdateBatch adAffectCurrent
     End If