Hi,
I have a page showing the result of a search criteria. I'm using VB script. I have given link to an attached file for each record. There is also a field "Number of downloads" in my table. When a user clicks on a particular link, I want to update (increment by 1) the No. of downloads field in my table, for that particular record. My code is as follows.
<TD nowrap borderColor=#80 0000 width="220"> <A id=D href= "http://localhost/MyPage/<%= trim(replace(rs (7),"#","")) %>" title="Click here to view full article"
onclick=<% sqlQuery = "Update Book set NoOfDownloads = NoOfDownloads+1 where SlNo = " & rs(9)
cn1.Execute sqlQuery %> >
where rs(7) is the attached file name and rs(9) is the SlNo(PK).
But this update query is executed every time the page is loaded, evenif not clicked. Also it is updating for all the records having attachments.
Plz help me.
Matsam
I have a page showing the result of a search criteria. I'm using VB script. I have given link to an attached file for each record. There is also a field "Number of downloads" in my table. When a user clicks on a particular link, I want to update (increment by 1) the No. of downloads field in my table, for that particular record. My code is as follows.
<TD nowrap borderColor=#80 0000 width="220"> <A id=D href= "http://localhost/MyPage/<%= trim(replace(rs (7),"#","")) %>" title="Click here to view full article"
onclick=<% sqlQuery = "Update Book set NoOfDownloads = NoOfDownloads+1 where SlNo = " & rs(9)
cn1.Execute sqlQuery %> >
where rs(7) is the attached file name and rs(9) is the SlNo(PK).
But this update query is executed every time the page is loaded, evenif not clicked. Also it is updating for all the records having attachments.
Plz help me.
Matsam
Comment