salve al forum ho fatto una ricerca, ma non ho trovato quello che cercavo,
ho una pagina da dove modifico i record in un db,
funziona tutto perfettamente tranne quando in uno dei campi viene digitato (')l'apice
posto un pezzo di codice se qualcuno sa dirmi dove toppo,
<%
function fixquotes (strtxt)
fixquotes = Replace(strtxt, "'","''")
end function
if len (request.Form)>0 then
dim conn, strConn
strConn = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = "& Server.MapPath ("../cartella/database.mdb")
Set conn = Server.CreateObject("ADODB.Connection")
Conn.Open StrConn
SQL = "select * from tabelladati where nome ='"
SQL = SQL & fixquotes(request.Form("IDA"))&"'"
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open SQL, conn, 1, 3
if rs.eof<>true and rs.bof<> true then
if len(request.Form("nome"))>0 then
rs.update "nome" , fixquotes(request.Form("nome"))
end if
if len(request.Form("indirizzo"))>0 then
rs.update "indirizzo", request.Form("indirizzo")
end if
ecc. ecc.
ma la function fixquotes non funziona?
aiutatemi che purtroppo vado sempre di corsa