472,350 Members | 1,586 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,350 software developers and data experts.

How to retreive picture from Ms Access Database

Dear Freinds,
I tried my best, Here i need Help to solve my problem.
My code:
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<%
set conn=server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.jet.oledb.4.0"
conn.Open(server.MapPath("picture.mdb"))
set objrs=objconn.Execute("select picture from picture whrere ID=1")
Response.ContentType="images/bmp"
Response.BinaryWrite(objrs("picture"))
conn.Close
%>
</BODY>
</HTML>
Please give me a immediate solution.please....
Oct 27 '06 #1
1 1742
Dear Freinds,
I tried my best, Here i need Help to solve my problem.
My code:
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<%
set conn=server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.jet.oledb.4.0"
conn.Open(server.MapPath("picture.mdb"))
set objrs=objconn.Execute("select picture from picture whrere ID=1")
Response.ContentType="images/bmp"
Response.BinaryWrite(objrs("picture"))
conn.Close
%>
</BODY>
</HTML>
Please give me a immediate solution.please....
There was only some little errors
try this

<%
set conn=server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.jet.oledb.4.0"
conn.Open(server.MapPath("picture.mdb"))
set objrs=conn.Execute("select picture from picture where ID=1")
Response.ContentType="images/bmp"
Response.BinaryWrite(objrs("picture"))
conn.Close
%>

Ok but now I try this code with images/jpg or jpeg for my example:
<%
set conn=server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.jet.oledb.4.0"
conn.Open(server.MapPath("test1.mdb"))
set objrs= conn.Execute("SELECT photo FROM photos where ID=1")
Response.ContentType="images/jpeg"
Response.BinaryWrite(objrs("photo"))
conn.Close
%>

The only thing I got is tons of ascii characters like this : $˙˙˙˙PackagePackage...

Can anyone help ??
Oct 27 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Lee | last post by:
Hello, This is a genral enquiry before I send out a more detailed request. I am unable to retreive image files from a mysql database using IE...
1
by: Tamer Sabry | last post by:
Hi, I am making a real estate database for my company. I am new to access. I made a picture field and I want to have different pictures for every...
2
by: Ulrike | last post by:
I need to bind in (thumbnail-sized) pictures into an Access Database in such a way that there is one picture for each record (abt. 3000 records on...
2
by: Lyn | last post by:
I am trying to embed a picture into a Bound Object Frame (Me!Photograph) with the following code which is based on MS article...
5
by: dirk nerlich | last post by:
Hi I want too create a picture database.How can I link a picture(tiff, JPG) on one datafield? If I use ole objekt I only see the filename but not...
1
by: Jean Christophe Avard | last post by:
Hi! I have a dataset where I have a field that is a image. I can't figure out how to retreive the imahe, I get the invalid paranmeter with this...
4
by: NASAdude | last post by:
I'm working on distributing a database using VS Tools for Office, and am having trouble with linked images on forms/reports. The image objects have...
1
by: mclewell | last post by:
I would like to start off by saying i'm in no way an expert by any means. I've had access since 97 and way back then set up a database for eBay...
6
n8kindt
by: n8kindt | last post by:
i have linked a mySQL database (that populates data in our webstore) with my Access 2007 database. i want to be able to see the images in access...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.