'**************************************
'modificare
'**************************************
Sub EditItem()
which=request("which")
if isNumeric(which) then
MySQL="SELECT * FROM " & table_CodAz & " Where " & strKey_10 & " = " & which
else
MySQL="SELECT * FROM " & table_CodAz & " Where " & strKey_10 & " = '" & Replace(which,"'","''") & "'"
end if
Set MyRs=Connection_Cod.Execute(MySQL)
Server.Execute("header.asp")
Response.write ("<div align=""left"" style=""padding:5px""><hr size=""1""><font color=""#FF0000""><p style=""line-height: 150%"">N.b. per poter usare l'apostrofo, devi inserirlo doppio in questa maniera '' il sistema ne fisserà uno solo. Se in modalità modifica trovi una frase apostrofata, devi riconfermarla con il doppio apostrofo cosi » '' « il sistema non accetta doppie virgole » " «</font></left><hr size=""1""></font></div>")
Response.write ("<FORM ACTION=""" & strFile_10 & "?mode=EditItemAction"" METHOD=POST>")
Response.write ("<input name=""IDAziende"" type=""hidden"" value=""" & MyRs(strKey_10) & """ ""Server.HTMLEncode(corpo)"" >")
numerocampi=MyRs.fields.count -1
for i=0 to numerocampi
if Not MyRs(i).name = "IDAziende" then
ThisRecord = MyRs(i)
ThisRecordName = MyRs(i).name
If IsNull(ThisRecord) or ThisRecord = "" Then
MyRs(i) = Replace(MyRs(i),"'","''") & "'"
end if
Response.write ("<div align=""left"" style=""padding:5px"">" & ThisRecordName & ":</div> ")
Response.write ("<div align=""left"" style=""padding:5px""><input style=""width:98%"" name=""" & ThisRecordName & """ type=""text"" value=""" & MyRs(i) & """ ""Server.HTMLEncode(corpo)""><br/></div>")
end if
next
Response.write ("<br/><hr><br/><center><INPUT NAME=""Invia"" TYPE=Submit Value=""Aggiorna""></center>")
Response.write ("</div>")
Response.write ("</FORM>")
MyRs.close
Set MyRs= Nothing
End Sub
Sub EditItemAction()
which = Request(strKey_10)
if isNumeric(which) then
MySQL="SELECT * FROM " & table_CodAz & " Where " & strKey_10 & " = " & which
else
MySQL="SELECT * FROM " & table_CodAz & " Where " & strKey_10 & " = '" & Replace(which,"'","''") & "'"
MySQL="SELECT * FROM " & table_CodAz & " REPLACE(which,"'","''") = '" strKey_10 "'"
end if
MySQL="Select * from " & table_CodAz
Set MyRs=Connection_Cod.Execute(MySQL)
numerocampi=MyRs.fields.count -1
for i=0 to numerocampi
if Not MyRs(i).name = "IDAziende" then
str = MyRs(i).name
strNames = Request(str)
if not i = numerocampi then
str1 = str1 & "[" & str & "] = '" & strNames & "',"
else
str1 = str1 & "[" & str & "] = '" & strNames & "'"
end if
end if
next
MySQL1="UPDATE " & table_CodAz & " SET " & str1 & " Where " & strKey_10 & " = '" & Replace(which,"'","''") & "'"
Set MyRs1=Connection_Cod.Execute(MySQL1)
Connection_Cod.Close
set Connection_Cod=nothing
Response.Redirect strFile_redirect
End Sub
end if