473,395 Members | 1,497 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 1774
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 5.2 on the mac OS X platform. I have built a...
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 record. My problem is no matter if I have an OLE...
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 the whole). Ideally, the pictures should show 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 http://support.microsoft.com/?id=158941: strPathname =...
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 the picture. Further I will give some information...
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 code... Try Dim buffer() As Byte =...
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 a default path\file set on the .Picture property,...
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 stock. i had the old micrografx picture publisher...
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 also. however, i only have a referring url to work...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.