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
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
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货