Search code examples
sql-server-2008ms-access-2003

Retrieve file stored as varbinary(max) filestream in SQL 2008 with MS Access


I have a MS Access 2003 mdb acting as a front end for a SQL 2008 back end. The back end contains a table with a varbinary(MAX) filestream column. I can use the front end to upload files to the database using a stored procedure. I'd like to store images in the BE for display in the front end, but I can't figure out how to bind the files stored in the db to an image object in the mdb. I thought of exporting the file in the db to a temp location, then binding the path to the image, but I can't seem to get at the file without the SQLFileSteam API which Access doesn't have a reference to. Does anyone know of a solution to this or a similar problem?


Solution

  • Just read out the varbinary(max) field into a Byte variable, then save that Byte to a (temp) file and bind your image control to that (temp) file