Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 IP Counter
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Step
Starting Member

3 Posts

Posted - 01 November 2003 :  12:15:34  Show Profile
Hello everybody.

Does anyone know why this code doesn't work well?
It is sending data to my .mdb file, that is not the problem.
But is doesn't display data on the page. I want to display the number of visitors with graphics.
Thank you very much!!!



<%
Dim Conn
Dim RS
Dim TotalVisited
Dim ImgSequence
Dim CharToReplace
Dim Query

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("hit_counter.mdb")

Set RS = Server.CreateObject("ADODB.Recordset")

Query = "SELECT * FROM Hits WHERE Hit_IP='" & Request.ServerVariables("REMOTE_ADDR") & "' AND Hit_Date=#" & DATE() & "#"
RS.Open Query, Conn, 3, 3

IF RS.EOF AND RS.BOF THEN
RS.AddNew
RS("Hit_Date") = Date()
RS("Hit_Time") = Time()
RS("Hit_IP") = Request.ServerVariables("Remote_Addr")
RS.Update
END IF

RS.Close

Select Case Request.QueryString ("Mode")


Case "Graphic"

RS.Open "SELECT COUNT (*) AS TotalVisits FROM Hits", conn, 3, 3

If Not RS.Eof and NOT RS.Bof Then

TotalVisits = Rs("TotalVisits")
RS.Close

For I = 1 to Len (TotalVisits)

CharToReplace = Mid(TotalVisits, I, 1)
ImgSequence = ImgSequence & "<img src='" & CharToReplace & ".gif' Border=0>"

Next

Response.Write ImgSequence

Else

Response.Write "<img src='0.gif' border=0>"

End If

End Select
%>

redbrad0
Advanced Member

USA
3725 Posts

Posted - 01 November 2003 :  15:25:49  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
Are you doing this in the url...

filename.asp?Mode=Graphic

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 03 November 2003 :  12:17:14  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
Was this it?

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

Step
Starting Member

3 Posts

Posted - 04 November 2003 :  12:36:52  Show Profile
I didn't try it yet. Thank you very very much. I'll let you know.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.29 seconds. Powered By: Snitz Forums 2000 Version 3.4.07