%@LANGUAGE="VBSCRIPT"%>
Page Counter
<%
Dim objConn
Dim objCmd
Set objConn = CreateObject("ADODB.Connection")
objConn.Open "Driver={SQL Server Native Client 10.0};Server=tcp:1393-pardue1.chem.purdue.edu;Database=courses;Trusted_connection=Yes"
Set objCmd = CreateObject("ADODB.Command")
objCmd.ActiveConnection = objConn
objCmd.CommandText = "getCount"
objCmd.CommandType = 4
objCmd.Parameters.Refresh()
objCmd.Parameters("@countName") = Request.QueryString("name")
objCmd.Execute
count = objCmd.Parameters("@countValue")
pad = " " & count
if count < 1000000 then
pad = " " & pad
end if
if count < 100000 then
pad = " " & pad
end if
if count < 10000 then
pad = " " & pad
end if
if count < 1000 then
pad = " " & pad
end if
if count < 100 then
pad = " " & pad
end if
if count < 10 then
pad = " " & pad
end if
%>
<% = "Visitors: " & pad %>