public const BLOCK_SIZE =10000Dim strFree As String
Dim lngFileLen As Long
Dim bytFile() As Byte
Dim lngBlocks As Long
Dim lngLeft As Long
Dim lngNum As Long=======
mvarphoto是图片的路径
If mvarPhoto <> "" Then
strFree = FreeFile
Open mvarPhoto For Binary Access Read As strFree
lngFileLen = LOF(strFree)
If lngFileLen > 0 Then
lngBlocks = lngFileLen / BLOCK_SIZE
lngLeft = lngFileLen Mod BLOCK_SIZE
ReDim bytFile(BLOCK_SIZE)
For lngNum = 1 To lngBlocks
Get strFree, , bytFile()
recFind("photo").AppendChunk bytFile()
Next lngNum
If lngLeft > 0 Then
ReDim bytFile(lngLeft)
Get strFree, , bytFile()
recFind("photo").AppendChunk bytFile()
End If
End If
End If
Dim lngFileLen As Long
Dim bytFile() As Byte
Dim lngBlocks As Long
Dim lngLeft As Long
Dim lngNum As Long=======
mvarphoto是图片的路径
If mvarPhoto <> "" Then
strFree = FreeFile
Open mvarPhoto For Binary Access Read As strFree
lngFileLen = LOF(strFree)
If lngFileLen > 0 Then
lngBlocks = lngFileLen / BLOCK_SIZE
lngLeft = lngFileLen Mod BLOCK_SIZE
ReDim bytFile(BLOCK_SIZE)
For lngNum = 1 To lngBlocks
Get strFree, , bytFile()
recFind("photo").AppendChunk bytFile()
Next lngNum
If lngLeft > 0 Then
ReDim bytFile(lngLeft)
Get strFree, , bytFile()
recFind("photo").AppendChunk bytFile()
End If
End If
End If
^_^
还有两个小问题:
1.在access97/2000中,BLOCK_SIZE最大可设为多少?
2.如何打开并修改数据库中的文件?
谢谢!
上面两个问题解决后一起给分....
^_^