本帖最后由 momozlm 于 2009-12-14 21:10:23 编辑

解决方案 »

  1.   

    这是一个以stream方式读取图形的代码,希望对你有帮助:http://download.csdn.net/source/1483930
      

  2.   

    Dim bit1() As Byte
    Open App.Path & "\照片\默认.jpg" For Binary As #1
    ReDim bit1(LOF(1) - 1)
    Get #1, , bit1
    connc = App.Path
    If Right(connc, 1) <> "\" Then
    connc = connc + "\"
    End If
    connc = "Driver={sql server};server=10.108.144.100;uid=sa;pwd=123321;database=k1"
    conn2.Open connc
    sql = "select * from xueyuanguanli where 身份证号='" & Text1(1).Text & "'"
    sql_data.Open sql, conn2, adOpenKeyset, adLockPessimistic
     sql_data.Fields("照片").AppendChunk bit1
     sql_data.Update
    conn2.Close
     Else
     MsgBox "员工省份证号不能空并且唯一,请重新输入,并且确保正确", , "警告"
     End If
      Close 1
      

  3.   

    'Picture1是PictureBox控件
    Picture1.Picture = LoadPicture("C:\tmp\img.jpg")
    '获取(0,0)左上角像素的RGB值
    debug.print right("00000000"+hex(Picture1.Point(0,0)),8)