Office中国论坛/Access中国论坛

标题: 我用链接表到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的操作

[此贴子已经被作者于2007-2-17 6:43:35编辑过]






欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3