标题: 我用链接表到sqlsvr,想读image图片,读不出来 [打印本页] 作者: liuyi_yt 时间: 2007-2-17 14:36 标题: 我用链接表到sqlsvr,想读image图片,读不出来 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的操作