Solved

Images & Access97 & Web pages...

Posted on 1998-12-29
11
169 Views
Last Modified: 2013-12-25
Anyone know how to display an Access db OLE field(with a image)in a web page(ASP)....

thank´s in advance
MG
0
Comment
Question by:mguedes
11 Comments
 
LVL 10

Expert Comment

by:MasseyM
ID: 1857505
From my experience it is not possible.   You can only do it from the SQL server database.  Access does not have that capability.  Otherwise, you would use the GetChunk method.

I recommend that you just have a link to the imageand go from there.
0
 

Author Comment

by:mguedes
ID: 1857506
I know how to make this with the SQL server.....but now i want make the same with ACCESS......
0
 
LVL 6

Expert Comment

by:PBall
ID: 1857507
Since I have never try this before, just guessing...
This has nothing to do with Response.BinaryWrite method?

'get the data here....
set rs = con.execute("SELECT thumbnail FROM rec WHERE recID =...')

response.contenttype = "images/gif"
response.binarywrite rs("thumbnail")
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:mguedes
ID: 1857508
the problem was that the ole field does not have just binary data....it contain an header description(i guess)
0
 
LVL 2

Expert Comment

by:Jagar
ID: 1857509
MasseyM was right there is almost no way to do this.  In order to do it you are going to have to process what is stored in the database and strip out all the OLE headers and other information.  Then use the binarywrite method.  Sorry I don't know how to do it, but that is what needs to be done for this to work.
0
 
LVL 28

Expert Comment

by:sybe
ID: 1857510
It can be done allright, I am doing it all the time. It depends very much on how you put the image into Access. If you insert the image into Access using the normal OLE-procedure, Access will mess around with the byte code of the image (it converts it to bitmap). So, the only way is to store the exact binary code of the image in Access. For that you have to write some VBA code, or use another tool.

Once the image is fine in Access, you can display it with ASP easily:


<%
Response.ContentType = "image/GIF"


Set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionTimeout = 5
Conn.CommandTimeout = 5
Conn.Open "DSN=Images"

strSQL = "SELECT * FROM Table WHERE ID=" & Request.Querystring("ID")
Set RSImage = Conn.Execute(strSQL)

Response.Binarywrite RSImage("Image")
%>
0
 

Author Comment

by:mguedes
ID: 1857511
Ok...i know this code. My problem is how to store the image in the access database...in binary field and from vb6...
0
 
LVL 28

Expert Comment

by:sybe
ID: 1857512
I use SA-FileUp from softartisans (www.softartisans.com) to store images into a database. I have seen it being done also with plain VBA. For that you have to use
AppendChunk.

Below follows a bit of code.

        MyData.Edit
       
        'Open Document
        Open strFile For Binary As #1 ' Open file.
        FileLength = LOF(1)
        i = 0
        Do While i < FileLength ' Loop until end of file.
            i = i + 1
            MyChar = InputB(1, #1)   ' Get one byte.
            MyData![Image].AppendChunk MyChar
        Loop
        Close #1    ' Close file.
       
        MyData.Update



0
 

Author Comment

by:mguedes
ID: 1857513
thank´s. do you know what kind of type must be the access field? submit an answer to glade you....
0
 

Author Comment

by:mguedes
ID: 1857514
i don´t need sa-fileup because i´m using a vb app to store the image in the database and next i upload the database to my www server.....and display the images with ASP´s...........
0
 
LVL 28

Accepted Solution

by:
sybe earned 20 total points
ID: 1857515
Access field must be OLE, so it can hold any binary information
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
manage footer size 4 73
xss alert in domino url 9 34
PHP Curl to output a url 7 50
Website Question - New Site 3 13
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question