diciamo che il codice che ho sviluppato fino ad ora potrebbe essere questo 
codice:
<%
'inizializzo la variabile
ValoreDB=0
Contatore=""
If Session("Counter")<>"" then 'visualizzo il contenuto della variabile di session dandogli la forma a 6 cifre adeguata
'valuto la lunghezza del valore e formo la cifra da visualizzare
If Len(Session("Counter"))=1 then
Contatore = "00000" & Session("Counter")
End if
If Len(Session("Counter"))=2 then
Contatore = "0000" & Session("Counter")
End if
If Len(Session("Counter"))=3 then
Contatore = "000" & Session("Counter")
End if
If Len(Session("Counter"))=4 then
Contatore = "00" & Session("Counter")
End if
If Len(Session("Counter"))=5 then
Contatore = "0" & Session("Counter")
End if
If Len(Session("Counter"))=6 then
Contatore = Session("Counter")
End if
End if
If Session("Counter")="" then 'devo controllare se nel db persiste il record con ID = 1
'apro la connessione con il db
set myConn = server.CreateObject("ADODB.Connection")
dim strConnDb
strConnDb = ""
strConnDb = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = G:/Progetti Lavori/Web Project/Da Fare/Tessuti/tessuti.mdb"
'strConnDb = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " & server.mappath("/mdb-database/tessuti.mdb")
myConn.Open(strConnDb)
set myRSComS = server.CreateObject("ADODB.Recordset")
mySqlSelect = "select * from ContatoreVisite where ID = 1"
myRSComS.Open mySqlSelect, myConn, 1 ,1
function formatta_sql(mia_stringa)
formatta_sql=replace(mia_stringa,"'","''",1,-1)
End function
'effettuo il controllo del valore contenuto nel campo Visitatore!
If myRSComS("Visitatore") = 999999 Then
'Allora riporto il valore a 1 e rendo valida la variabile di sessione!
ValoreDB=1
Session("Counter")=ValoreDB
'Aggiorno il db!
dim strInsertDati
strInsertDati=""
strInsertDati="update ContatoreVisite set Visitatore=:1: where id=:1:"
strInsertDati=replace(strInsertDati,"1",formatta_sql(cstr(ValoerDB)))
myConn.Execute strInsertDati
End if
If myRSComS("Visitatore") < 999999 Then
'Allora incremento il valore e rendo valida la variabile di sessione!
ValoreDB=(myRSComS("Visitatore")+1)
Session("Counter")=ValoreDB
'Aggiorno il db!
dim strInsertDati2
strInsertDati2=""
strInsertDati2="update ContatoreVisite set Visitatore=:1: where id=:1:"
strInsertDati2=replace(strInsertDati2,":1:",formatta_sql(cstr(ValoerDB)))
myConn.Execute strInsertDati2
End If
myRSComS.Close
set myRSComS=nothing
myConn.Close
set myConn=nothing
'valuto la lunghezza del valore e formo la cifra da visualizzare
If Len(Session("Counter"))=1 then
Contatore = "00000" & Session("Counter")
End if
If Len(Session("Counter"))=2 then
Contatore = "0000" & Session("Counter")
End if
If Len(Session("Counter"))=3 then
Contatore = "000" & Session("Counter")
End if
If Len(Session("Counter"))=4 then
Contatore = "00" & Session("Counter")
End if
If Len(Session("Counter"))=5 then
Contatore = "0" & Session("Counter")
End if
If Len(Session("Counter"))=6 then
Contatore = Session("Counter")
End if
End if
%>
premetto inoltre che non funziona mi da errore di sintassi e che lo sviluppo si basa sul fatto che nella tabella vi sia già un record con id logico=1 e con campo di tipo numerico=1!
in questo modo se la variabile di sessione è <>"" allora devoe solo riportare il suo contenuto a video altrimenti a variabile ="" controlla il valore dentro il campo e a seconda di questo valora incrementa o azzera il valore efettuando poi un update del campo stesso, update che non funziona...
qualche suggerimento o soluzione?
Grazie