codice:
'---Recupero i valori della Form Id_Product = Trim(Replace(Request("Id_Product"), "'", "''"))
Id_Art = Trim(Replace(Request("id_Art"), "'", "''"))
from = Trim(Replace(Request("from"), "'", "''"))
id_Cot = Trim(Replace(Request("id_Cot"), "'", "''"))
'Commerciale
C1a = Trim(Replace(Request("C1a"), ".", ","))
Ccomm = Trim(Replace(Request("Ccomm"), ".", ","))
'Scarto
Sdef = Trim(Replace(Request("Sdef"), ".", ","))
Scre = Trim(Replace(Request("Scre"), ".", ","))
Satt = Trim(Replace(Request("Satt"), ".", ","))
Ssfi = Trim(Replace(Request("Ssfi"), ".", ","))
'3° Scelta
Tdef = Trim(Replace(Request("Tdef"), ".", ","))
Timp = Trim(Replace(Request("Timp"), ".", ","))
Tmfe = Trim(Replace(Request("Tmfe"), ".", ","))
Tmsm = Trim(Replace(Request("Tmsm"), ".", ","))
Tmfi = Trim(Replace(Request("Tmfi"), ".", ","))
'Ricottura
Rmve = Trim(Replace(Request("Rmve"), ".", ","))
Risp = Trim(Replace(Request("Risp"), ".", ","))
Rfar = Trim(Replace(Request("Rfar"), ".", ","))
Rsve = Trim(Replace(Request("Rsve"), ".", ","))
Application("Dat_Product")=from
'Controllo dei campi compilati
stringa_campo=""
stringa_valore=""
mod_campo=""
If Id_Art <> "" Then
stringa_campo = "Id_Art"
stringa_valore ="'"&Id_Art&"'"
mod_campo="Id_Art='"&Id_Art&"'"
End If
If from <> "" Then
stringa_campo = stringa_campo&",data"
stringa_valore =stringa_valore&",'"&from&"'"
mod_campo=mod_campo&", data='"&from&"'"
End If
If id_Cot <> "" Then
stringa_campo = stringa_campo&",id_Cot"
stringa_valore =stringa_valore&",'"&id_Cot&"'"
mod_campo=mod_campo&", id_Cot='"&id_Cot&"'"
End If
'Commerciale
If C1a <> "" Then
stringa_campo = stringa_campo&",C1a"
stringa_valore =stringa_valore&",'"&C1a&"'"
mod_campo=mod_campo&", C1a='"&C1a&"'"
End If
If Ccomm <> "" Then
stringa_campo = stringa_campo&",Ccomm"
stringa_valore =stringa_valore&",'"&Ccomm&"'"
mod_campo=mod_campo&", Ccomm='"&Ccomm&"'"
End If
'Scarto
If Sdef <> "" Then
stringa_campo = stringa_campo&",Sdef"
stringa_valore =stringa_valore&",'"&Sdef&"'"
mod_campo=mod_campo&", Sdef='"&Sdef&"'"
End If
If Scre <> "" Then
stringa_campo = stringa_campo&",Scre"
stringa_valore =stringa_valore&",'"&Scre&"'"
mod_campo=mod_campo&", Scre='"&Scre&"'"
End If
If Satt <> "" Then
stringa_campo = stringa_campo&",Satt"
stringa_valore =stringa_valore&",'"&Satt&"'"
mod_campo=mod_campo&", Satt='"&Satt&"'"
End If
If Ssfi <> "" Then
stringa_campo = stringa_campo&",Ssfi"
stringa_valore =stringa_valore&",'"&Ssfi&"'"
mod_campo=mod_campo&", Ssfi='"&Ssfi&"'"
End If
'3° Scelta
If Tdef <> "" Then
stringa_campo = stringa_campo&",Tdef"
stringa_valore =stringa_valore&",'"&Tdef&"'"
mod_campo=mod_campo&", Tdef='"&Tdef&"'"
End If
If Timp <> "" Then
stringa_campo = stringa_campo&",Timp"
stringa_valore =stringa_valore&",'"&Timp&"'"
mod_campo=mod_campo&", Timp='"&Timp&"'"
End If
If Tmfe <> "" Then
stringa_campo = stringa_campo&",Tmfe"
stringa_valore =stringa_valore&",'"&Tmfe&"'"
mod_campo=mod_campo&", Tmfe='"&Tmfe&"'"
End If
If Tmsm <> "" Then
stringa_campo = stringa_campo&",Tmsm"
stringa_valore =stringa_valore&",'"&Tmsm&"'"
mod_campo=mod_campo&", Tmsm='"&Tmsm&"'"
End If
If Tmfi <> "" Then
stringa_campo = stringa_campo&",Tmfi"
stringa_valore =stringa_valore&",'"&Tmfi&"'"
mod_campo=mod_campo&", Tmfi='"&Tmfi&"'"
End If
'Ricottura
If Rmve <> "" Then
stringa_campo = stringa_campo&",Rmve"
stringa_valore =stringa_valore&",'"&Rmve&"'"
mod_campo=mod_campo&", Rmve='"&Rmve&"'"
End If
If Risp <> "" Then
stringa_campo = stringa_campo&",Risp"
stringa_valore =stringa_valore&",'"&Risp&"'"
mod_campo=mod_campo&", Risp='"&Risp&"'"
End If
If Rfar <> "" Then
stringa_campo = stringa_campo&",Rfar"
stringa_valore =stringa_valore&",'"&Rfar&"'"
mod_campo=mod_campo&", Rfar='"&Rfar&"'"
End If
If Rsve <> "" Then
stringa_campo = stringa_campo&",Rsve"
stringa_valore =stringa_valore&",'"&Rsve&"'"
mod_campo=mod_campo&", Rsve='"&Rsve&"'"
End If
If Id_Product<>"" then
'**** Salvo la modifica
SQL = " UPDATE Product SET " &mod_campo& " Where ID="&Id_Product
Set RS = Conn.Execute(SQL)
else
'**** Salvo nuovo record
Set RS1 = Server.CreateObject("ADODB.RecordSet")
SQL = " Insert INTO Product ("&stringa_campo&") VALUES ("&stringa_valore&")"
'Response.Write(SQL)
'Response.Flush
Set RS1 = Conn.Execute(SQL)
end if
Response.Redirect "Product.asp"
%>