方法一:用控件直接绑定数据库。
方法二:用LongBytes字段存储Picture的存盘文件,文件用loadpicture或savepicture方法写入读出。

解决方案 »

  1.   

    Pardox中可以这样,建一个blob类型的字段(用于存储二进制值)
    Table.FieldByName('xx').Assign(picturebox.image);
    picturebox.image.Assign(Table.FieldByName('xx'))
      

  2.   

    Sooy!我问的是如何存取PictureBox的Picture的值,不是路径名
      

  3.   

    同意Un1的观点,可以把PictureBox中的图像数据存到库中,
    需设置数据源及绑定的字段。
      

  4.   

    getchunk & appendchunk,以下是msdn的例子。AppendChunk 和 GetChunk 方法范例
    该范例使用 AppendChunk 和 GetChunk 方法用其他记录中的数据填写图像字段。Public Sub AppendChunkX()   Dim cnn1 As ADODB.Connection
       Dim rstPubInfo As ADODB.Recordset
       Dim strCnn As String
       Dim strPubID As String
       Dim strPRInfo As String
       Dim lngOffset As Long
       Dim lngLogoSize As Long
       Dim varLogo As Variant
       Dim varChunk As Variant
       
       Const conChunkSize = 100   ' 打开连接
       Set cnn1 = New ADODB.Connection
          strCnn = "Provider=sqloledb;" & _
          "Data Source=srv;Initial Catalog=pubs;User Id=sa;Password=; "
       cnn1.Open strCnn
       
       ' 打开 pub_info 表。
       Set rstPubInfo = New ADODB.Recordset
       rstPubInfo.CursorType = adOpenKeyset
       rstPubInfo.LockType = adLockOptimistic
       rstPubInfo.Open "pub_info", cnn1, , , adCmdTable
       
       ' 提示复制徽标。
       strMsg = "Available logos are : " & vbCr & vbCr
       Do While Not rstPubInfo.EOF
          strMsg = strMsg & rstPubInfo!pub_id & vbCr & _
             Left(rstPubInfo!pr_info, InStr(rstPubInfo!pr_info, ",") - 1) & _
             vbCr & vbCr
          rstPubInfo.MoveNext
       Loop
       strMsg = strMsg & "Enter the ID of a logo to copy:"
       strPubID = InputBox(strMsg)
       
       ' 将徽标复制到大块中的变量。
       rstPubInfo.Filter = "pub_id = '" & strPubID & "'"
       lngLogoSize = rstPubInfo!logo.ActualSize
       Do While lngOffset < lngLogoSize
          varChunk = rstPubInfo!logo.GetChunk(conChunkSize)
          varLogo = varLogo & varChunk
          lngOffset = lngOffset + conChunkSize
       Loop
       
       ' 从用户得到数据。
       strPubID = Trim(InputBox("Enter a new pub ID:"))
       strPRInfo = Trim(InputBox("Enter descriptive text:"))
       
       ' 添加新记录,将徽标复制到大块中。
       rstPubInfo.AddNew
       rstPubInfo!pub_id = strPubID
       rstPubInfo!pr_info = strPRInfo   lngOffset = 0 ' 重置位移。
       Do While lngOffset < lngLogoSize
          varChunk = LeftB(RightB(varLogo, lngLogoSize - lngOffset), _
             conChunkSize)
          rstPubInfo!logo.AppendChunk varChunk
          lngOffset = lngOffset + conChunkSize
       Loop
       rstPubInfo.Update
       
        ' 显示新添加的数据。
       MsgBox "New record: " & rstPubInfo!pub_id & vbCr & _
          "Description: " & rstPubInfo!pr_info & vbCr & _
          "Logo size: " & rstPubInfo!logo.ActualSize   ' 删除新记录,因为这只是演示。
       rstPubInfo.Requery
       cnn1.Execute "DELETE FROM pub_info " & _
          "WHERE pub_id = '" & strPubID & "'"   rstPubInfo.Close
       cnn1.Close   End Sub
      

  5.   

    上面的例子我没做过,不过在asp中显示图象我是做过的,如下:
    sqlstring="select 照片 from table where 编号='"+loginid+"'"
    Set rs1 = cn.Execute(sqlstring)
    PicSize = rs1("照片").ActualSize
    Pic =  rs1("照片").GetChunk(PicSize)
    Response.BinaryWrite Pic希望能对你有些帮助