I would suggest you to do converting blob to JPG from SQL Server itself. you can use following code in SP or anywhere else to do it right from SQL Server
Main Topics
Browse All TopicsHello!
I'm trying to determine the feasiblitly of processing a SQL Server table through MS Access, and for each SQL Server record, converting a BLOB field in the record to an individual JPG file in Windows. For example, if 10 SQL Server records were processed, then 10 JPG files would be produced in a Windows directory.
I'm assuming the use of MS Access, because Access can access SQL Server (thru ODBC) for input, and a Windows directory for output, simultaneously.
So, first of all, is this possible using MS Access? If so, what Access facility do I need to use?
Thanks!
GLFord
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
if you wish to do it from C# code, than do follow the link below
http://www.sqlhub.com
puppydogbuddy:
Thanks for those links! I found Leban's A2KLoadSaveJpeg Access application very interesting. The main difference between this application and my need, is that I would like to process a table that has a BLOB field in each row, and automatically (in batch) have the program read each row, convert the BLOB field to a JPG and write out the JPG. (The name for each JPG is contained as a field in the same row as the BLOB). So, in other words, I need the process to run "lights out", once an operator clicks a button on an Access form to kick it off. Is it easy to convert a BLOB to JPG directly, without going through an image control in Access?
Thanks!
GLFord
AFAIK, with BLOB you can only input/output binary "chunks" (see link below). Other than Access 2007 (stores jpg directly) or Leban's method, compessed >>>storage<<< for OLE not available in Access.
see : http://support.microsoft.c
Excerpt from prior posted link to Jamie's software:
On a final note, of the three techniques discussed, I prefer to use the last technique as the images are neatly stored away inside the database file and we do not have to suffer the bloat associated with the first. For a working example of storing images as binary large object bitmaps (BLOB) in an OLE field, please feel free to download and evaluate my Image Albums application. A free example of storing files in this way using DAO with viewable source code can be found by downloading the getBinary zip file, an Access 97 file that can also be converted to Access 2000 or 2002 depending on which version you are running.
The final technique can be tricky to set up but has the advantage of storing images inside the database, meaning that password protection is possible and also avoids the bloat associated with the first technique, as the images are stored reflecting their true size. For this technique I would again recommend using the "file open" dialog, allowing the user to browse to an image. We can use either DAO or ADO (in Access 2000 or 2002) to grab the image file and read it into the OLE field in chunks. To display the image we have to extract it from the database to a temporary file and like the second technique, use an image control to display it by setting the control's "picture" property to the path of the temporary file. Once we are finished with the temporary file we can use the VBA "kill" command to delete it. Unfortunately, as with the second technique, the same problem with Access continuous forms exists. If displaying the images using single forms is not adequate you could take the time to create a customized form to display more than one individual image, although unfortunately this task is made awkward by the fact that Access does not support control arrays. In addition, this technique also incurs a marginal overhead when compared to the second, as the image files first have to be extracted from the database before we can view them.
I used the last link in puppydogbuddy's first posting. Therefore I have awarded the points to puppydogbuddy. The link itself did not provide the answer, but I was able to follow links from this page to find the solution here:
http://www.ammara.com/acce
Using MS Access, I used the first Access function on this page successfully, to be able to convert SQL-Server BLOBs to JPGs, as per the code snippet below. You pass the Windows name to be given to the JPG as the first argument, and then the BLOB field as the second argument. I converted a SQL Server table with 400 rows (400 BLOBS), into 400 individual JPGs, each with an individual name based on the key field of each row. Perfect! Thanks to all who participated in this question!
GLFord
Business Accounts
Answer for Membership
by: puppydogbuddyPosted on 2009-03-30 at 08:50:53ID: 24020123
see these links: jpeggif.ht m savejpeg.h tm
tk/article s/handling images.htm l
http://www.lebans.com/load
http://www.lebans.com/load
for general reference on image handling in ms access:
http://www.jamiessoftware.