SHARE
Facebook X Pinterest WhatsApp

Images in ASP

Jul 20, 2010
ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



by Armand Datema

Here is a new tutorial on how to include images in ASP. Without using blobs or binary
fields.

Here is a new tutorial on how to include images in ASP.

First we start of with the basic HTML

imagedbase

Now lets create the database connection

set conntemp=server.createobject(“adodb.connection”)
Set con =
Server.CreateObject(“ADODB.Connection”)

Now lets open the database connection,
create the SQL Statement and open the result set,  my
ODBC name here is image and the table i am
going to query is called image

con.Open
“DSN=image;”
Set rs =
server.createobject(“adodb.recordset”)
rs.Open “select *
from image”, con
do While not rs.EOF
%>

The code so far
was pretty standard, creating a connection, opening recordset
and run the query. Now lets go to te interesting part, how to
add the images 🙂

First we need to add a bit
HTML code for the table display

Now lets finish the rest
of the code and close the HTML tags.

rs.moveNext
loop
%>

Image
description
Actual
Image
In the next cell you see the

In the next part of the
code we write the name of the image as plain text.

Some extra HTML code for
the table display

picture

Now we add the image, as you can see
from the line code below, its actually very easy, just put the
response.write … in the place of where you would normally
put the name of the image.  

.gif” width=”100″
height=”100″
>

Recommended for you...

What Is a Container? Understanding Containerization
What Is a Print Server? | How It Works and What It Does
Nisar Ahmad
Dec 8, 2023
What Is a Network Policy Server (NPS)? | Essential Guide
Virtual Servers vs. Physical Servers: Comparison and Use Cases
Ray Fernandez
Nov 14, 2023
ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.