Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Disk Space Monitoring ASP Page problem

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,39326
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> Disk Space Monitoring ASP Page problem
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Disk Space Monitoring ASP Page problem - 11/1/2006 1:13:12 AM   
  ruaand

 

Posts: 1
Score: 0
Joined: 11/1/2006
Status: offline
Hallo,

I have a asp page that connects to a SQL database and displays disk space reports on multiple sql servers but for some reason I cannot get the asp page to connect to the database.

Can anyone please help me with the code that I have attached below?

Thanks,

Ruaan



<!-- #include file="adovbs.inc" -->
<HTML>
<H1>Disk Monitor</H1>

<%
Session.Timeout = 480
set connection=server.createObject("ADODB.Connection")
connection.OPEN "SERVER=sql2k\instance1;DATABASE=DiskMonitor;UID=DiskUser;PWD=Disk;DRIVER={SQL Server};"
set rs = server.createobject("ADODB.Recordset")
rs.cursortype = adopenstatic
query = "select Computer,Drive,DiskSize,FreeSpace,Percentage,date,Color=case when percentage<16 then 'R' when percentage>16 and percentage<21 then 'Y' when percentage>20 then 'G'  end from FreeSpace order by computer,Drive"
rs.open query,connection %>
<TABLE  border=1 bordercolor= rgb(114,150,145) cellPadding=1 cellSpacing=0  width="75%" align=center>
<TD></TD>
<TR>

<TD bgColor=white><B><font  color = "black" face="VERDANA" STYLE="font-size:10px">
Server</B></TD>
<TD bgColor=white><B><font  color = "black"  face="VERDANA" STYLE="font-size:10px">
Drive</B></TD>
<TD bgColor=white><B><font  color = "black"  face="VERDANA" STYLE="font-size:10px">
Disk Space (MB)</B></TD>
<TD bgColor=white><B><font  color = "black"  face="VERDANA" STYLE="font-size:10px">
FreeSpace (MB)</B></TD>
<TD bgColor=white><B><font  color = "black"  face="VERDANA" STYLE="font-size:10px">
Percentage Free</B></TD>
<TD bgColor=white><B><font  color = "black"  face="VERDANA" STYLE="font-size:10px">
TimeStamp</B></TD>

<!--rgb(61,32,87) -->

<TR><TD></td></tr>
<%do while not rs.eof%>
<TR>
<TD bgColor=CCCCCC><font  color = "black" face="VERDANA"  STYLE="font-size:10px"  >
<%=rs("Computer")%></B></TD>
<TD bgColor=white><font  color = "black"  face="VERDANA"  STYLE="font-size:10px"  >
<%=rs("Drive")%></B></TD>
<TD bgColor=white><font  color = "black"  face="VERDANA"  STYLE="font-size:10px"  >
<%=rs("DiskSize")%></B></TD>
<TD bgColor=white><font  color = "black"  face="VERDANA"  STYLE="font-size:10px"  >
<%=rs("FreeSpace")%></B></TD>
<% if rs("Color") ="R" then %>
<TD bgColor=red><font  color = "black"   face="VERDANA"  STYLE="font-size:10px"  >
<% end if %>
<% if rs("Color") ="Y" then %>
<TD bgColor=yellow><font  color = "black"   face="VERDANA"  STYLE="font-size:10px"  >
<% end if %>
<% if rs("Color") ="G" then %>
<TD bgColor=blue<font  color = "black"   face="VERDANA"  STYLE="font-size:10px"  >
<% end if %><%=rs("Percentage")%></B></TD>
<TD bgColor=white><font  color = "black"   face="VERDANA"  STYLE="font-size:10px"  >
<%=rs("Date")%></B></TD>
<%rs.movenext%>
</TR>
<%loop%>
</table>

 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> Disk Space Monitoring ASP Page problem Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts