Print Page | Close Window

Results of data in DB

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=8049
Printed Date: 30 March 2026 at 12:17pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Results of data in DB
Posted By: Deon
Subject: Results of data in DB
Date Posted: 13 December 2003 at 2:21am

Hi there,

I have an Access 2k DB with a field where the owner of the website can input a value out of 10. It's for the interior condition of a car. He wants the result, when displaying the record, to be presented as a linear graph, almost like a poll. Example: when 8 is put in as the value, is should display as 80% on the graph.

I work with DWMX and ASP VBScript.

Thanx very much for your help.
Deon

 

 




Replies:
Posted By: adnan248999
Date Posted: 13 December 2003 at 8:19am

Hmm this isn't the best way but should work

Create a table on your page you want to display the results and set the width to whatever you like in pixels then use the following example.

<%

Dim intresult

Set rs = Server.CreateObject("ADODB.Recordset")

rs.open ("SELECT fldName FROM tblYOURTABLE"), Your_Conn_String

intresult = rs("fldName")

Select Case intresult

Case "1"

intresult = "10%"

Case "2"

intresult = "20%"

Case "3"

intresult = "30%"

Case "4"

intresult = "40%"

Case "5"

intresult = "50%"

Case "6"

intresult = "60%"

Case "7"

intresult = "70%"

Case "8"

intresult = "80%"

Case "9"

intresult = "90%"

Case "10"

intresult = "100%"

End Select

%>

<table border=0 width=300 height=20>

<tr><td width=<%=intresult%> bgColor="#336699"></td></tr>

</table>

<%

set rs=nothing

set Your_Conn_String=Nothing

%>



-------------
They call me Bruce Lee


Posted By: Deon
Date Posted: 13 December 2003 at 8:29am

Thanx for the reply.

I will give it a shot and let yuo know.

Regards,
Deon

 



Posted By: Deon
Date Posted: 14 December 2003 at 4:25am

Bruce,

I stumbled across this one:
http://www.4guysfromrolla.com/webtech/042199-2.shtml - http://www.4guysfromrolla.com/webtech/042199-2.shtml

and find it to work very well. Only problem is that this uses DSN-less (ODBC) and I use DSN-less. Any idea on how to change the code? This will realy help me.

Regards,
Deon

 



Posted By: dpyers
Date Posted: 14 December 2003 at 9:47pm
http://www.connectionstrings.com/ - http://www.connectionstrings.com/  should have something.

-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: Deon
Date Posted: 15 December 2003 at 11:19am

Hi,

the connection I can do and it works. Only thing is that I don;t know what else to delete from the script.

Deon

 




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net