BLOBS and MS Access

Results 1 to 3 of 3

Thread: BLOBS and MS Access

  1. #1
    Louis Gamerman Guest

    Default BLOBS and MS Access

    Having a problem with getting BLOB&#039;s out of an Access database and streaming them to the client.<BR><BR>I&#039;ve tried the technique where you set the Content Type to "image/gif" and then do a BinaryWrite from the ADO recordset, but this fails miserably in MS Access.<BR><BR>I seem to recall reading somewhere that the problem may be that MS Access and Foxbase, unlike SQL Server, add special headers into to their "OLE Objects" (read: BLOB) data when it is entered into the database.<BR><BR>Is this so?<BR><BR>If so, how can I get around this.<BR><BR>For example, I want to develop an ASP page where an IMG tag draws its GIF or JPG data source (via the SRC attribute) from another ASP page which streams binary image data (similar to the examples on this site).<BR><BR>How do I do this with a GIF or JPEG stored in an MS Access database?<BR><BR>Do I have to trim off the header somehow? How do I do this?

  2. #2
    Join Date
    Dec 1969

    Default RE: BLOBS and MS Access

    The best way is to put a filename (or a part of) in the database and leaving the pictures in a folder on the web. This will speed up your application.<BR>If it&#039;s a picture that come along with a record-id you can check if file &#060;id&#062;.gif exists in a particulary folder, if yes display it. Using this you even don&#039;t need a field to put a filename in!<BR>If I was you I would really consider it, putting pictures in a databases makes the database very heavy. I know it looks like a clean solution...

  3. #3
    Louis Gamerman Guest

    Default RE: BLOBS and MS Access

    I had considered that, but I wanted to keep everything together in the database, to make it easier to keep together and transmit from user to user for local use, etc. This is a "rough and dirty" system where simplicity is better than efficiency.<BR><BR>One of my big concerns was having several paths hardcoded in the database, which would have to be changed every time the server structure changed. I wanted to avoid this need.<BR><BR>But, you do raise an excellent idea - since all the people have auto-number ID&#039;s, it would be possible to have a single reference table with one entry for the all the images&#039; shared path, and then find the user&#039;s ID, to find the image corresponding to their id in the directory. Since the user ID is a primary key (i.e. unique), I could assure no naming collisions.<BR><BR>I did find an article which addresses my exact problem of stripping the OLE headers from the Access BLOB&#039;s for display on the web in the MS Knowledge Base at:<BR><BR><BR><BR>It deals with Bitmap&#039;s, and I&#039;m not sure how I&#039;d adapt it to JPEG&#039;s and GIF&#039;s - any ideas?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts