How do I display an image from Sql Server with Microsoft Access?

后端 未结 2 1023
暖寄归人
暖寄归人 2020-12-11 08:59

I upsized an Access 2007 database to SQL Server 2008 R2. The images are in SQL Server as image type. Access has link to the table containing the image. When I try to disp

2条回答
  •  感情败类
    2020-12-11 09:35

    Since Access 2010, you can use the PictureData property to store and display images from SQL Server. You will need a bound control for an SQL Server data type varbinary(max), which can be hidden, and an unbound Image control in MS Access. You can now simply say:

    Private Sub Form_Current()
        Me.MSAccessImageControl.PictureData = Me.SQLServerImage
    End Sub
    

    And vice versa. You will need to add some error management to that, but very little else.

提交回复
热议问题