IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
ASP Classic
Search ASP Classic Group:

Advanced
-Collapse +Expand ASP Classic Store

Prestwood eMagazine

May Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyASP Classic Coding BoardASP Classic Coding Topic   Print This     

Display image

Display image in ASP Classic Coding topic (part of our ASP Classic Coding group).

Quick Search: Display   Display image  
Most Recent Post
aka51
MD
I am attempting to display an image that is stored in an access Database as an OLE Object
the code is as follows but when it rum it shows garbage caracters to the screen

   
<%

'Step 2: grab the picture from the database
Dim objConn, objRS, strSQL
strSQL = "SELECT image FROM test WHERE ID = 1 ;"

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "DSN=budget_demo"

Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open strSQL, objConn

%>



<%
'Step 3: Set the ContentType to image/jpg
Response.ContentType = "image/JPEG"


'Step 4: Use Response.BinaryWrite to output the image
Response.BinaryWrite objRS("Image")

//Response.BinaryWrite objRS("image")
%>



<%
'Clean up...
objRS.Close
Set objRS = Nothing

objConn.Close
Set objConn = Nothing
%>
Peace love and happiness
 Posted 17 years ago (Thread Starter)
Comment Quote
About aka51 -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #8789, No Replies Be the first!
Thread Started 1/2/2003 7:54:00 AM
View Counter=2898
Location=MD  
Joined=18 years ago   MB Posts=25  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1307A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #8789 Counter
2898
Since 4/2/2008
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2020 Prestwood IT Solutions.   [Security & Privacy]