如果空件不支持数据绑定,那就要通过程序提取图像。你既然能保存,那提取的过程只不过是反过来。用getchunk

解决方案 »

  1.   

    http://www.csdn.net/expert/topic/596/596216.xml?temp=.9612238
      

  2.   

    public const BLOCK_SIZE =10000
    Public Function ReadPic(ByVal fldPic As adodb.Field, picShow As PictureBox) As Boolean
        Dim strTemp As String
        Dim strFree As String
        Dim lngFldSize As Long
        Dim bytFile() As Byte
        Dim lngBlocks As Long
        Dim lngLeft As Long
        Dim lngNum As Long    Dim BLOCK_SIZE As Integer
        BLOCK_SIZE = 10000<--这样行么On Error GoTo ErrHandler
        strTemp = App.Path & "\temppic.tmp"
        strFree = FreeFile
        Open strTemp For Binary Access Write As strFree
        lngFldSize = fldPic.ActualSize
        If lngFldSize = 0 Then Exit Function
        lngBlocks = lngFldSize \ BLOCK_SIZE
        lngLeft = lngFldSize Mod BLOCK_SIZE
        For lngNum = 1 To lngBlocks
            bytFile() = fldPic.GetChunk(BLOCK_SIZE)
            Put strFree, , bytFile()
        Next lngNum
        
        If lngLeft > 0 Then
            bytFile() = fldPic.GetChunk(lngLeft)
            Put strFree, , bytFile()
        End If
        Close strFree
        picShow.Picture = LoadPicture(strTemp)<---到这里就跳到Err了
        ReadPic = True
        Exit Function
    ErrHandler:
        MsgBox "ERR"
        ReadPic = False
    End Function