Now what do I do? RRS feed

  • Question

  • OK, I was able to create a database using the SQL Management tool easy enough. I called it HitCounter.

    I created a table, no problem, called it HitTable, so I want to connect to the database from inside my web server.

    I made 3 columns, IP, Hits, and Last to generate a modicum of statistics as a test case.

    Also, I presume its easy enough to change the database as I think of something to add.


    here is the code so far, icky as it is.....


    Dim strServername, strLocalname, strServerIP

    strServername = LCase(Request.ServerVariables("SERVER_NAME"))   ' Server's name
    strServerIP = LCase(Request.ServerVariables("LOCAL_ADDR"))      ' Server's IP address
    strRemoteIP =  LCase(Request.ServerVariables("REMOTE_ADDR"))    ' Client's IP address

    'LOCK light cause a problem with a lot of hits
    counter = Application("counter")
    counter = counter + 1
    Application("counter") = counter

    <title>Green Relations Group</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta http-equiv="Content-Language" content="en-us">
    <meta name="robots" content="ALL, INDEX, FOLLOW">
    <meta name="description" content="Green Relations provides Corporate Communications, Public Relations & Investor Relations services.">
    <meta name="keywords" content="global, finance, communications, stock, market, money, gold, commodities, 101, spin, doctor">

    <body bgcolor="#00CC66">
     <li><font size="5"><a href="cc.asp">Corporate Communications</a></font></li>
     <li><font size="5"><a href="ir.asp">Public Relations</a></font></li>
     <li><font size="5"><a href="ir.asp">Investor Relations</a></font></li>
     <li><font size="5"><a href="it.asp">Web Design</a> </font> </li>
    <p align="center"></p>
    <p align="left">contact the webmaster at green relations dawt com</p>
    <p align="center"></p>
    <p align="center"></p>

    <p><% Response.Write (counter & " Visitors since the last reboot. Your IP address is " & strRemoteIP)%>
    (c) 2006 Green Relations Group,. All Rights Reserved.</p>



    Monday, January 23, 2006 8:16 PM