Dim rs As New ADODB.Recordset//sql 字段是二进制的bmp 连接表显示是ole对象
Dim Istm As ADODB.Stream
rs.Open "SELECT 图片 FROM dbo.图库 WHERE id=" & [Forms]![图库]![id], CurrentProject.Connection, adOpenKeyset, adLockOptimistic
Set Istm = New ADODB.Stream
With Istm
.Mode = adModeReadWrite
.Type = adTypeBinary
.Open
.Write rs("图片")
.SaveToFile "c:\image.jpg"
End With
Me.Image1.Picture = "c:\image.jpg"
rs.Close
Istm.Close
Kill "c:\image.jpg"
Set rs = Nothing
Set Istm = Nothing//请教sql<image>在access的操作
[此贴子已经被作者于2007-2-17 6:43:35编辑过]
|