Ciao
ottengo questo errore:
Microsoft JET Database Engine error '80040e14' Syntax error in UPDATE statement.
Inserendo dopo SQL di update:
response.write SQL
response.flush
vedo che i valori inseriti correspondono ma poi non vengono aggiornati nel db xchè ottengo l'errore di sopra.
Il codice della mia pagina è:
<%LANGUAGE="VBSCRIPT"%>
<%
if not Session("LoginStatus") then Response.Redirect("login.asp")
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="it" xml:lang="it">
<head>
<meta http-equiv="Content-Type" content="text/html; chars_contenutiet=iso-8859-16" />
<title>MODIFICA CONTENUTI</title>
<link href="/CSS/pannello.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table id="modifica_contenuti_elencoB">
<caption>
MODIFICA CONTENUTI ELENCO B (Vers.2.3)
</caption>
<colgroup>
<col class="col1modifica_contenuti_elencoB" />
<col class="col2modifica_contenuti_elencoB oddmodifica_contenuti_elencoB" />
<col class="col3modifica_contenuti_elencoB" />
<col class="col4modifica_contenuti_elencoB oddmodifica_contenuti_elencoB" />
<col class="col5modifica_contenuti_elencoB" />
<col class="col6modifica_contenuti_elencoB oddmodifica_contenuti_elencoB" />
<col class="col7modifica_contenuti_elencoB" />
<col class="col8modifica_contenuti_elencoB oddmodifica_contenuti_elencoB" />
<col class="col9modifica_contenuti_elencoB" />
<col class="col10modifica_contenuti_elencoB oddmodifica_contenuti_elencoB" />
<col class="col11modifica_contenuti_elencoB" />
<col class="col12modifica_contenuti_elencoB oddmodifica_contenuti_elencoB" />
</colgroup>
<thead>
<tr>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<%
Dim codice_contenuti_v
codice_contenuti_v = Request.QueryString("CODICE_CONTENUTI")
Dim id_v
id_v = Request.QueryString("ID_CONTENUTI_PAGINE")' id è la variabile che recupera il valore dall'url e non è ID_contenuti ne id_v
if request.querystring("update")="" then
Set rs_contenuti = Server.CreateObject("ADODB.Recordset")
Sql= "SELECT * from TabContenutiPagineWeb where ID_CONTENUTI_PAGINE = "&id_v&" "' AND ID_CONTENUTI_PAGINE = "&id_v&" "
rs_contenuti.Open sql, cn, 1
'''While Not rs_contenuti.eof
'response.write("ID_contenuti")
If not rs_contenuti.eof then
%>
<form id="form1" method="post" action="?update=add&ID_CONTENUTI_PAGINE=<%=req uest.querystring("ID_CONTENUTI_PAGINE")%>">
<tr>
<td colspan="2">
<%
Dim sBasePath
sBasePath = Request.ServerVariables("PATH_INFO")
sBasePath = Left( sBasePath, InStrRev( sBasePath, "/" ) )
Dim DESCR_CONTENUTO1
DESCR_CONTENUTO1 = rs_contenuti("DESCR_CONTENUTO1")
'chiamata all'editor
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
'oFCKeditor.BasePath = "/fckeditor/"
oFCKeditor.ToolbarSet = "Default"
oFCKeditor.Height = "650"
oFCKeditor.Width = "1000"
'variabile per i contenuti
oFCKeditor.Value = DESCR_CONTENUTO1
oFCKeditor.Create "DESCR_CONTENUTO1"
%>
</td>
</tr>
<tr>
<th>ID</th>
<td><%=rs_contenuti("ID_CONTENUTI_PAGINE")%></td>
</tr>
<tr>
<th>COD_CONTENUTI</th>
<td><input class="textbox" type="text" name="CODICE_CONTENUTI" value="<%=rs_contenuti("CODICE_CONTENUTI")%>" /></td>
</tr>
<tr>
<th>TITOLO PAGINA:</th>
<td><input class="textbox" type="text" name="TITLE" value="<%=rs_contenuti("TITLE")%>" /></td>
</tr>
<tr>
<th>META DESCRIPTION:</th>
<td><input class="textarea" type="text" name="META_DESCRIPTION" value="<%=rs_contenuti("META_DESCRIPTION")%>" /></td>
</tr>
<tr>
<th>META KEYWORDS:</th>
<td><input class="textarea" type="text" name="META_KEYWORDS" value="<%=rs_contenuti("META_KEYWORDS")%>" /></td>
</tr>
<tr>
<th>META LINGUA:</th>
<td><input class="textbox" type="text" name="LANGUAGE" value="<%=rs_contenuti("LANGUAGE")%>" /></td>
</tr>
<tr>
<th>META ROBOTS:</th>
<td><input class="textbox" type="text" name="ROBOTS_CONTENT" value="<%=rs_contenuti("ROBOTS_CONTENT")%>" /></td>
</tr>
<tr>
<td colspan="3">
<div id="bottone">
<input type="hidden" name="ID_CONTENUTI_PAGINE" value="<%=id_v%>" />
<input type="submit" name="modifica" value="modifica" />
</div>
</td>
</td>
</form>
<% End If %>
<tr>
<td colspan="3">
<div id="torna_elenco">
Torna all'elenco
</div>
</td>
</tr>
</tbody>
</table>
<%
rs_contenuti.Close
Set rs_contenuti = Nothing
end if
%>
<%
if request.querystring("update")="add" then
%>
<%
DESCR_CONTENUTO1=replace(request.form("DESCR_CONTE NUTO1"), "'", "''")'campo MEMO
CODICE_CONTENUTI=replace(request.form("CODICE_CONT ENUTI"), "'", "''")'campo TESTO
TITLE=replace(request.form("TITLE"), "'", "''")'campo TESTO
META_KEYWORDS=replace(request.form("META_KEYWORDS" ), "'", "''")'campo TESTO
META_DESCRIPTION=replace(request.form("META_DESCRI PTION"), "'", "''")'campo MEMO
LANGUAGE=replace(request.form("LANGUAGE"), "'", "''")'campo TESTO
ROBOTS_CONTENT=replace(request.form("ROBOTS_CONTEN T"), "'", "''")'campo TESTO
%>
<%
SQL = "UPDATE TabContenutiPagineWeb SET CODICE_CONTENUTI='"&CODICE_CONTENUTI&"', DESCR_CONTENUTO1='"&DESCR_CONTENUTO1&"', TITLE='"&TITLE&"', META_KEYWORDS='"&META_KEYWORDS&"', META_DESCRIPTION='"&META_DESCRIPTION&"', LANGUAGE='"&LANGUAGE&"', ROBOTS_CONTENT='"&ROBOTS_CONTENT&"' where ID_CONTENUTI_PAGINE="&request.form("ID_CONTENUTI_P AGINE")&""
response.write SQL
response.flush
cn.Execute(SQL)
response.redirect("modifica_contenuti_elencoB_2010 .asp?id="&id_v)
%>
<%end if%>
</body>
</html>
Potete aiutarmi?