Sì PoLe,
ecco il codice....
<%
ByteRicevuti = Request.TotalBytes
if ByteRicevuti > 0 then
DatiRicevuti = Request.BinaryRead(ByteRicevuti)
For i = 1 To lenB(DatiRicevuti)
FileBinario = FileBinario & chr(ascB(midB(DatiRicevuti,i,1)))
Next
FirmaFile = left(FileBinario,instr(FileBinario,"" & vbCrLf)-1)
ArrPezzi = split(FileBinario,FirmaFile)
for item = 1 to ubound(ArrPezzi)-1
Inizio = instr(ArrPezzi(item),"" & vbCrLf & "" & vbCrLf)
Intestazione = left(ArrPezzi(item),Inizio-1)
Inizio = Inizio + len("" & vbCrLf) + len("" & vbCrLf)
ContenutoFile = mid(ArrPezzi(item),Inizio,len(ArrPezzi(item))-Inizio-1)
if instr(Intestazione,"txtTitoloEvento") > 0 then
txtTitoloEvento = ContenutoFile
end if
if instr(Intestazione,"cmbCategoria") > 0 then
txtCategoria = ContenutoFile
end if
if instr(Intestazione,"cmbGiorno") > 0 then
txtGiorno = ContenutoFile
end if
if instr(Intestazione,"cmbMese") > 0 then
txtMese = ContenutoFile
end if
if instr(Intestazione,"cmbAnno") > 0 then
txtAnno = ContenutoFile
end if
if instr(Intestazione,"cmbGiornoFine") > 0 then
txtGiornoFine = ContenutoFile
end if
if instr(Intestazione,"cmbMeseFine") > 0 then
txtMeseFine = ContenutoFile
end if
if instr(Intestazione,"cmbAnnoFine") > 0 then
txtAnnoFine = ContenutoFile
end if
if instr(Intestazione,"cmbOra") > 0 then
txtOra = ContenutoFile
end if
if instr(Intestazione,"txtCitta") > 0 then
txtCitta = ContenutoFile
end if
if instr(Intestazione,"txtIndirizzo") > 0 then
txtIndirizzo = ContenutoFile
end if
if instr(Intestazione,"txtInfo") > 0 then
txtInfo = ContenutoFile
end if
if instr(Intestazione,"txtSito") > 0 then
txtSito = ContenutoFile
end if
if instr(Intestazione,"txtMail") > 0 then
txtMail = ContenutoFile
end if
if instr(Intestazione,"txtReferente") > 0 then
txtReferente = ContenutoFile
end if
if instr(Intestazione,"txtOrganizzazione") > 0 then
txtOrganizzazione = ContenutoFile
end if
if instr(Intestazione,"cmbTipo") > 0 then
txtTipo = ContenutoFile
end if
if instr(Intestazione,"txtDescrizione") > 0 then
txtDescrizione = ContenutoFile
end if
next
end if
Set ObjConn = Server.CreateObject("ADODB.Connection")
Set ObjRst = Server.CreateObject("ADODB.Recordset")
ObjConn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/mdb-database/Eventi.mdb")
StrSql = "SELECT * FROM Evento"
ObjRst.Open StrSql, ObjConn, 3, 3
ObjRst.AddNew
ObjRst.Fields("Comune") = Session("Comune")
ObjRst(2) = txtTitoloEvento
ObjRst(3) = txtCategoria
ObjRst(4) = txtGiorno
ObjRst(5) = txtMese
ObjRst(6) = txtAnno
ObjRst(7) = txtGiornoFine
ObjRst(8) = txtMeseFine
ObjRst(9) = txtAnnoFine
ObjRst(10) = txtOra
ObjRst(11) = txtCitta
ObjRst(12) = txtIndirizzo
ObjRst(13) = txtInfo
ObjRst(14) = txtSito
ObjRst(15) = txtMail
ObjRst(16) = txtReferente
ObjRst(17) = txtOrganizzazione
ObjRst(18) = txtTipo
ObjRst(19) = txtDescrizione
ObjRst.UpDate
Dim Arr(19)
Dim Arr2(19)
ObjRst.MoveLast
For i = 1 to 19
Arr(i) = ObjRst(i)
Next
ObjRst.MovePrevious
For i = 1 to 19
Arr2(i) = ObjRst(i)
Next
Uguali = true
For i = 1 to 19
If Arr(i) <> Arr2(i) Then
Uguali = False
End If
Next
If Uguali = True Then
ObjRst.MoveLast
ObjRst.Delete
End If
%>
Per me è impossibile che il form venga inserito 2 volte....!!!
La parte in rosso serve per eliminare l'ultimo record inserito (e per sicurezza viene confrontato con quello precedente)... Non sapevo proprio come risolvere il problema sennò...
Avevo pensato alla possibilità che questa pagina venisse chiamata 2 volte, magari da qualche riga sfuggita al controllo...
Ma non non ho trovato niente...
Ciao....