Working with pictures in MS Access and SQL Server -


how 1 go about:

  1. getting images/pictures sql database
  2. viewing pictures sql database using ms access form?

i use odbc link between 2 databases no problems @ all, i'm struggling understand need achieve i'm trying achieve.
have tried google, haven't yet come across right information.

getting pictures in , out of sql server database:

you need getchunk , appendchunk functions that.
here's tutorial: how read , write blobs using getchunk , appendchunk.
tutorial bit dated, far know still best way load/save pictures in database vba.
note in sql server, should use varbinary(max) field (instead of image suggested in tutorial) store pictures.

displaying pictures in ms access form:

you can't display picture directly database. have load database (see above), store in temp folder , display there.

to windows' temp folder, use environ("temp") or the gettemppath api function.

to display picture can either set background of form:

me.picture = "c:\...\temp\picture.jpg" 

...or use image control:

me.nameofimagecontrol.picture = "c:\...\temp\picture.jpg" 

Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -