SHARE
Facebook X Pinterest WhatsApp

Bargraph 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

Now lets make a simple bargraph with asp. We start with thebasic HTML Tags and the opening of the database and recordset. This time we dont use a DSN but the actual database itself.

Now lets make a simple bargraph with asp. We start with thebasic HTML Tags and the opening of the database and recordset. This time we dont use a DSN but the actual database itself.

curDir = Server.MapPath(

graph.mdb

)


Create the Database Connection


Set con = Server.CreateObject(

ADODB.Connection

)


con.Open

DBQ=

&

curDir

&

;Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;

Now lets open the recordset and run the query


set conntemp=server.createobject(“adodb.connection”)
Set rs = server.createobject(“adodb.recordset”)
rs.Open “select * from graph”, con
do While not rs.EOF %>

Now all you need to do is make te height of the image the content of the recordsource like this
height=”

One final note: make sure you set the alignment of the images to bottom. Otherwise the images will
be centered in the middle of the table, and wont allign correctly.

height=””   align=”absbottom”> height=”
  align=”absbottom”>
height=”
 
align=”absbottom”>
1998 1999 Y2K

And at last we close our
HTML tags and ASP code

rs.moveNext
loop
%>

This completes yer ASP page,
look below for the complete code of
imagedbase.asp

curDir =


Server.MapPath(

graph.mdb

)


Create the Database


Connection


Set con =


Server.CreateObject(

ADODB.Connection

)


con.Open


DBQ=

&

curDir

&

;Driver={Microsoft Access Driver


(*.mdb)};DriverId=25;FIL=MS Access;


set


conntemp=server.createobject(

adodb.connection

)


Set rs =


server.createobject(

adodb.recordset

)


rs.Open

select *


from graph

, con


do While not rs.EOF %

>

height=””
align=”absbottom”>
height=””  
align=”absbottom”>
height=””  
align=”absbottom”>
1998 1999 Y2K

rs.moveNext
loop
%>

 

Download Code

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.