Counting visits to productpages with database countfield

Counting visits to productpages with database countfield

am 17.04.2005 15:03:26 von stokjeroen

Hi Could someone please help me with this problem?

A website with different productpages
The database should keep a record of hits of productpages. So I added
a field hitCount to the table Pagina of the database Kris.mdb The
productpages have a URL that goes like: /onderwerp.asp?paginaId=..

With this code i cannot get connected to the datsebase. The two
records in the body are not recognized. It must be the SQL line
because if i change that to "SELECT * FROM Pagina" it does show some
records in the body.


<%@LANGUAGE="VBSCRIPT"%>
<%Response.Buffer=true%>
<%
set rsCount=Server.CreateObject("ADODB.recordset")
rsCount.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=" & Server.Mappath("fpdb/kris.mdb")
rsCount.Source = "UPDATE Pagina SET hitCount = hitCount + 1 WHERE
PaginaId = " & Request("paginaId")
rsCount.CursorLocation = 2
rsCount.CursorType = 3
rsCount.LockType = 3
rsCount.Open()
rsCount_numRows = 0

%>


Test



hitcount <%=(rsCount.Fields.Item("hitCount").Value)%>


paginaId <%=(rsCount.Fields.Item("ProductId").Value)%>


test




<%
rsCount.Close()
%>