Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Results of data in DB
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Results of data in DB

 Post Reply Post Reply
Author
Deon View Drop Down
Newbie
Newbie


Joined: 13 December 2003
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Deon Quote  Post ReplyReply Direct Link To This Post Topic: Results of data in DB
    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

 

 



Edited by Deon
Back to Top
adnan248999 View Drop Down
Newbie
Newbie
Avatar

Joined: 30 November 2003
Location: United Kingdom
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote adnan248999 Quote  Post ReplyReply Direct Link To This Post 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

%>

Back to Top
Deon View Drop Down
Newbie
Newbie


Joined: 13 December 2003
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Deon Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2003 at 8:29am

Thanx for the reply.

I will give it a shot and let yuo know.

Regards,
Deon

 

Back to Top
Deon View Drop Down
Newbie
Newbie


Joined: 13 December 2003
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Deon Quote  Post ReplyReply Direct Link To This Post Posted: 14 December 2003 at 4:25am

Bruce,

I stumbled across this one:
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

 

Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 14 December 2003 at 9:47pm
http://www.connectionstrings.com/ should have something.

Lead me not into temptation... I know the short cut, follow me.
Back to Top
Deon View Drop Down
Newbie
Newbie


Joined: 13 December 2003
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Deon Quote  Post ReplyReply Direct Link To This Post 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

 

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.