Access FE - SQL Server BE insert/display image

JohnPapa

Registered User.
Local time
Today, 21:56
Joined
Aug 15, 2010
Messages
1,120
I use Access as my FE and SQl Server as my BE.

I want to be able to insert an image into the SQl Server BE from my Access FE and be able to display this image.

I looked at the following link

Insert a picture into a Access table with a SQL Server Backend - Stack Overflow

but it gets stuck at

Code:
Me!imgLogo = MyImage

when running

Code:
' save current record
     If Me.Dirty Then Me.Dirty = False
    
     Dim MyImage() As Byte
    
     MyImage = GetFileBytes(Me.txtLogo)
    
     Me!imgLogo = MyImage
     Me.Dirty = False

The error is "Run-time error '438' Object doesn't support this property or method'
 
If I read that link properly, you may be missing a step. Try:
Code:
Me.imgLogo.PictureData = MyImage
 
If I read that link properly, you may be missing a step. Try:
Code:
Me.imgLogo.PictureData = MyImage
With your suggestion the image appears on the form, but it does not get saved in the SQL Server DB, so that I can display it from the SQL Server Db.
 
Your suggestion

Code:
Me.imgLogo.PictureData = MyImage

works on a report as well, but does not print the image, when I print the report.
 
To store I may have to use GetChunk and AppendChunk.

To invoke from SQL Server I need to copy file to local folder and read file.

I just need to figure out how to do this.
 
On the no printing problem, if I convert to .pdf it prints ok.
 

Users who are viewing this thread

Back
Top Bottom