Thanks everybody. You helped a lot. I found a good code at
It works great but there is a stange pb. When you replace your url by a PDF file from your directory, you'll get more records than the click. For instance, if I click once, instead of having one record in the db, I'll get 3 or 4 record total. Any idea?
It does that only with pdf files.
Here it is
<%' Check to see if there is any input
' if not display the form for input
u_input=request.form("u_input"

%>
<center>
<form action="<%= request.servervariables("script_name"

%>" method="post">
<input type="submit" value="View">
<% if u_input <> "" then %>
Clicks by
<% else %>
Select a Report
<% end if %>
<select size="1" name="u_input">
<option <% if u_input="URL" then response.write "selected " end if %>value="URL">URL</option>
<option <% if u_input="Day" then response.write "selected " end if %>value="Day">Day</option>
<option <% if u_input="Month" then response.write "selected " end if %>value="Month">Month</option>
<option <% if u_input="IP" then response.write "selected " end if %>value="IP">IP</option>
</select>
</form>
</center>
<%' When there is input display the data
if u_input <> "" then
' Name of the Access db
accessdb="clicks"
' Connection to the db
cn="DRIVER={Microsoft Access Driver (*.mdb)};"
cn=cn & "DBQ=" & server.mappath(accessdb)
' Create a server record set object
set rs = server.createobject("ADODB.Recordset"
sql = "Clicks_by_" & u_input
' Execute the sql
rs.Open sql, cn
%>
<table border=3 align=center>
<tr>
<% ' Write out all the elements requested in the
' sql statement as table headers
for each element in rs.fields%>
<th><%= ucase(element.name) %></th>
<% next
' End table headers %>
</tr>
<tr>
<% ' Write out all the values in the record
do while not rs.eof
for each element in rs.fields %>
<td align=left><%= rs(element.name) %></td>
<%
next
' end of record %>
</tr>
<% ' Move to the next record
rs.movenext
' Loop to the beginning
loop%>
</table>
<% end if 'End check for user input %>