Displaying Pictures Still No Luck

G

Guest

First off I am not sure of the best way to save a picture
in an Access Database Table. So any insight to this would
be helpful.

Second In the code below I have a Details webpage that
comes up from the "Item Number" that is picked from the
previous page. All text comes up fine in the "Details
Page" but I am not sure of the proper coding to display
the corresponding Picture. Any help would be greatly
appreciated and if more explanation is needed I would be
glad to give it via email.

Here goes: There is a page before this that selects
the "Item Number" and uses it in a hyperlink to the "Herb
Details" Page which this code is for



<html>



<head>

<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">

<title>New Page 1</title>

<meta name="Microsoft Theme" content="ricepapr 1011,
default">

</head>

<body>

<%

Dim conn, ItemNum, ConnectionString, Query,
HDetails 'Command Object

ConnectionString = "Driver={Microsoft Access Driver
(*.mdb)};Dbq=c:\Inetpub\wwwroot\fpdb\Customers2000_be.mdb;
Uid=admin;Pwd="

set conn = server.createobject("adodb.connection")

conn.open ConnectionString

ItemNum = (Request("[Item Number]"))

If ItemNum = " " Then

Response.Write "No Item Number Was Sent.<p>"

else

Query = "SELECT * FROM tblHerbs WHERE [Item Number]= '" &
ItemNum & "'"

Set HDetails = conn.Execute(Query)

%>

<tr>

<td><%=HDEtails("Item Number")%>&nbsp;</td>
<td><%=HDetails("Product Name")%>&nbsp;</td>

**I HAVE A FIELD CALLED "PICTURES" THAT I WOULD LIKE TO
ADD TO DISPLAY THE CORRESPONDING PICTURE HERE**

<td><%=HDetails("Magical")%>&nbsp;</td
 
K

Kevin Spencer

If there is any way to avoid saving your images to an Access database, you
should think about going that way. For example, the simplest thing to do is
to save the image to a file location, and store information about the iamge,
tis location, etc, in the database as text. Access is particularly bad for
saving binary file types, as it stores a header in the OLE Object field
along with the image, and the header and image are stored as a single binary
record. Therefore, when fetching an image form an Access Ole Object field,
it is necessary to write code that binarily strips out the header
information and isolates the image by itself. This is far from a beginner's
programming task, and causes a lot of performance load on the server.

You can work with binary files in SQL Server (or MSDE) much more easily, as
the file is stored without any header, but you will still have performance
issues.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top