Hi, I am having a problem with this little click through counter.
I am not sure its written correctly but works fine adding up the visits from links on my site to external websites, when I query with postcardid
I am now using author as a query so need it to do the same for each author. The postcardid is in tblgreetingpost cards and linked to id in tblLinkTrackerL og
Each postcardid has a unique author in tblgreetingpost cards
The two tables in question are tblLinkTrackerL og and tblgreetingpost cards.
Basically I suppose as postcardid from tblgreetingpost cards is related to id in tblLinkTrackerL og it somehow needs to add where postcardid = author or a query author = postcardid
Any help would be great.
Thanks
Richard
I am not sure its written correctly but works fine adding up the visits from links on my site to external websites, when I query with postcardid
I am now using author as a query so need it to do the same for each author. The postcardid is in tblgreetingpost cards and linked to id in tblLinkTrackerL og
Each postcardid has a unique author in tblgreetingpost cards
The two tables in question are tblLinkTrackerL og and tblgreetingpost cards.
Basically I suppose as postcardid from tblgreetingpost cards is related to id in tblLinkTrackerL og it somehow needs to add where postcardid = author or a query author = postcardid
Any help would be great.
Thanks
Richard
Code:
<%
Const adOpenStatic = 3
Const adLockReadOnly = 1
Const adCmdText = &H0001
' This needs to be ' for SQL Server and # for Access
Const DATE_DELIMITER = "#"
Dim iLinkId
Dim cnnLinkTracker, rsLinkTracker
Dim strTemp
iLinkId = CLng(Request.QueryString("lid"))
iLinkId = CLng(Request.QueryString("postcardid"))
Set cnnLinkTracker = Server.CreateObject("ADODB.Connection")
cnnLinkTracker.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath("/fpdb/greetingcardpro.mdb"), "", ""
Set rsLinkTracker = Server.CreateObject("ADODB.Recordset")
rsLinkTracker.Open "SELECT SUM(hit_count) FROM tblLinkTrackerLog WHERE link_id = " & iLinkId & ";", cnnLinkTracker, adOpenStatic, adLockReadOnly, adCmdText
Response.Write "" & rsLinkTracker.Fields(0).Value & "" & vbCrLf
rsLinkTracker.Close
Set rsLinkTracker = Nothing
cnnLinkTracker.Close
Set cnnLinkTracker = Nothing
%>
Comment