Do not use on any
shared computer
August 30, 2008 04:21am pdt
 
[x]
Attachment Details

Variables error/ Script Error

Hello everyone.
        I can't seem to figure out how to make this script work.
Please Help This is not my area of expertise but I am learning.
Thanks in advance.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
<%
'On error resume next
 
Dim GRID
set objConnection=Server.CreateObject("ADODB.Connection")
objConnection.ConnectionTimeout = 15
objConnection.CommandTimeout = 10
objConnection.Mode = 3 'adModeReadWrite 
 
if objConnection.state = 0 then
   objConnection.Open Application("DB_Connection_ConnectionString")
end If
 
strGridSQL = "SELECT SYS_GRID.G_NUMBER AS GRIDNUM, SYS_GRID.G_NAME AS GRIDNAME " & _
             "FROM SYS_GRID;"
 
set objRSGRID=Server.CreateObject("ADODB.RecordSet")
objRSGRID.Open strGridSQL,objConnection,3,3
Do Until objRSGRID.eof
   for GRID = 1 to 20
       if GRID = objRSGRID("GRIDNUM") then
          GRIDNUMBER" & GRID & " = objRSGRID("GRIDNAME")
       end if
   next
Loop          
objRSGRID.Close
Set objRSGRID = Nothing
 
Response.Write("<table border= width= cellspacing=0 cellpadding=0 "& VBCrLF)
response.write("<tr><td width='80' align='center' style='border: 1px ridge #800000' bgcolor='#000000'>" & "<b> <font face='Verdana' style='font-size: 65%' " & _
               "color='#FFFF00'>Locations</font></b></td><td  width='48' align='center' style='border: 1px ridge #800000' bgcolor='#000000'><font face='Verdana' style='font-size: 55%' " & _
               "color='#FFFF00'>" & GRIDNUMBER1 & "</font></td><td width='48' align='center' style='border: 1px ridge #800000' bgcolor='#000000'><font face='Verdana' style='font-size: 55%' " & _
               "color='#FFFF00'>" & GRIDNUMBER2 & "</font></td><td width='48' align='center' style='border: 1px ridge #800000' bgcolor='#000000'><font face='Verdana' style='font-size: 55%' " & _
               "color='#FFFF00'>" & GRIDNUMBER3 & "</font></td><td width='48'align='center' style='border: 1px ridge #800000' bgcolor='#000000'><font face='Verdana' style='font-size: 55%' " & _
               "color='#FFFF00'>" & GRIDNUMBER4 & "</font></td><td width='48'align='center' style='border: 1px ridge #800000' bgcolor='#000000'><font face='Verdana' style='font-size: 55%' " & _
               "color='#FFFF00'>" & GRIDNUMBER5 & "</font></td><td width='48' align='center' style='border: 1px ridge #800000' bgcolor='#000000'><font face='Verdana' style='font-size: 55%' " & _
               "color='#FFFF00'>" & GRIDNUMBER6 & "</font></td><td width='48' align='center' style='border: 1px ridge #800000' bgcolor='#000000'><font face='Verdana' style='font-size: 55%' " & _
               "color='#FFFF00'>" & GRIDNUMBER7 & "</font></td><td width='48' align='center' style='border: 1px ridge #800000' bgcolor='#000000'><font face='Verdana' style='font-size: 55%' " & _
               "color='#FFFF00'>" & GRIDNUMBER8 & "</font></td><td width='48' align='center' style='border: 1px ridge #800000' bgcolor='#000000'><font face='Verdana' style='font-size: 55%' " & _
               "color='#FFFF00'>" & GRIDNUMBER9 & "</font></td><td width='48' align='center' style='border: 1px ridge #800000' bgcolor='#000000'><font face='Verdana' style='font-size: 55%' " & _
               "color='#FFFF00'>" & GRIDNUMBER10 & "</font></td><td width='48'align='center' style='border: 1px ridge #800000' bgcolor='#000000'><font face='Verdana' style='font-size: 55%' " & _
               "color='#FFFF00'>" & GRIDNUMBER11 & "</font></td><td width='48' align='center' style='border: 1px ridge #800000' bgcolor='#000000'><font face='Verdana' style='font-size: 55%' " & _
               "color='#FFFF00'>" & GRIDNUMBER12 & "</font></td><td align='center' style='border: 1px ridge #800000' bgcolor='#000000'><font face='Verdana' style='font-size: 55%' " & _
               "color='#FFFF00'>" & GRIDNUMBER13 & "</font></td><td align='center' style='border: 1px ridge #800000' bgcolor='#000000'><font  face='Verdana' style='font-size: 55%' " & _
               "color='#FFFF00'>" & GRIDNUMBER14 & "</font></td><td align='center' style='border: 1px ridge #800000' bgcolor='#000000'><font face='Verdana' style='font-size: 55%' " & _
               "color='#FFFF00'>" & GRIDNUMBER15 & "</font></td><td align='center' style='border: 1px ridge #800000' bgcolor='#000000'><font face='Verdana' style='font-size: 55%' " & _
               "color='#FFFF00'>" & GRIDNUMBER16 & "</font></td><td align='center' style='border: 1px ridge #800000' bgcolor='#000000'><font face='Verdana' style='font-size: 55%' " & _
               "color='#FFFF00'>" & GRIDNUMBER17 & "</font></td><td align='center' style='border: 1px ridge #800000' bgcolor='#000000'><font face='Verdana' style='font-size: 55%' " & _
               "color='#FFFF00'>" & GRIDNUMBER18 & "</font></td><td align='center' style='border: 1px ridge #800000' bgcolor='#000000'><font face='Verdana' style='font-size: 55%' " & _
               "color='#FFFF00'>" & GRIDNUMBER19 & "</font></td></tr>" & "</td></tr>" )
 
bkgcolor="bgcolor=#cccccc"
%>
Start your free trial to view this solution
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Question Stats
Zone: Web Development
Question Asked By: vico1
Solution Provided By: GreenGhost
Participating Experts: 2
Solution Grade: A
Views: 0
Translate:
Loading Advertisement...
 
[+][-]Expert Comment by hielo

Rank: Sage

Expert Comment by hielo:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by vico1
Author Comment by vico1:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Accepted Solution by GreenGhost

Rank: Guru

Accepted Solution by GreenGhost:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by vico1
Author Comment by vico1:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Open Discussion
Open Discussion
 
Comment by GreenGhost
Yes, of course it needs some modifications. I made minimal changes to make the code functional. :)

For example, I don't see that you close the database connection.

Also, you are mixing html layout like bgcolor properties and font tags with css styles. You should use css for all layout.
 
 
20080723-EE-VQP-34 / EE_QW_2_20070628