我想保存图片数据到数据库(SQL SErver 2000)中,请问如何做,非常感谢!

解决方案 »

  1.   

    http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=19363
      

  2.   

    保存图片到数据库
    private sub save()
    Dim Chunk() As Byte
    Filename="a.jpg"
    Chunk() = Image2Chunk(Filename)                
    rs.Fields("thumb").AppendChunk Chunk()            
    rs.Update
    end subPrivate 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 Function