fejl når jeg skal opdatere en post i min database
Microsoft JET Database Engine error '80040e14'Syntax error in UPDATE statement.
/test/admin/visbestyr.asp, line 21
*** visbestyr.asp ****
<!-- #include file="databaseforbindelse.asp" -->
<!DOCTYPE html>
<HTML lang="da">
<HEAD>
<TITLE> Tabeller i HTML 5 </TITLE>
<META charset="utf-8" />
<META name="keywords" content="" />
<META name="description" content="" />
</HEAD>
<%
id = Request.Form ("id")
Tabelnavn = "bestyr"
If Request.ServerVariables("CONTENT_LENGTH") <> 0 Then ' Opdatering
sql="update bestyr set titel='" & Replace(request.form("titel"), "'", "''") & "', navn='" & Replace(request.form("navn"), "'", "''") & "', adresse='" & Replace(request.form("adresse"), "'", "''") & "', tlf='" & Replace(request.form("tlf"), "'", "''") & "', mobil='" & Replace(request.form("mobil"), "'", "''") & "', email='" & Replace(request.form("email"), "'", "''") & "', opgaver='" & Replace(request.form("opgaver"), "'", "''") & "', where id=" & request.form("id")
'response.write sql
conn.execute(sql)
response.redirect "admin1.asp"
Else
Id = Request.QueryString ("id")
' ** Inserted by Jon Brohauge 2002/08/02
' ** Hvis der ikke er specificeret et id, så vis liste over alle nyheder sorteret efter dato, nyest først.
If Id = 0 Then
' ** Vis nyhedsliste
Set rs=Conn.Execute ("Select * from " & Tabelnavn & " WHERE 'titel'")
%>
<body>
<center>
<br>
<table cellspacing=0 border=0 cellspacing="0" cellpadding="5" width=320>
<%
If not(rs.bof or rs.eof) Then
while not(rs.eof)
%>
<tr>
<td class="menutxt"><%=rs("titel")%> <%=rs("navn")%></td>
<td class="menutxt"><a href="visbestyr.asp?emne=admin&emne2=retbestyr&id=<%=rs("id")%>">Ret</a>
</td>
</tr>
<%
rs.movenext
wend
Else
Response.Write "Ingen nyheder at rette"
End If
%>
</table>
<%
Else
' ** Vis valgte nyhed
Set rs=Conn.Execute ("Select * from " & Tabelnavn & " Where id=" & Id & "")
%>
<center>
<table cellspacing=0 border=0 cellspacing="0" cellpadding="5" width=320>
<Form Action=visbestyr.asp method="post">
<tr>
<td width="64">Titel</td>
<td align=right width="236"><input type="text" name="titel" size="32" value="<%=rs("titel")%>"></td>
</tr>
<tr>
<td width="64">Navn</td>
<td align=right width="236"><input type="text" name="navn" size="32" value="<%=rs("navn")%>"></td>
</tr>
<tr>
<td width="64">Adresse</td>
<td align=right width="236"><input type="text" name="adresse" size="32" value="<%=rs("adresse")%>"></td>
</tr>
<tr>
<td width="64">Tlf</td>
<td align=right width="236"><input type="text" name="tlf" size="32" value="<%=rs("tlf")%>"></td>
</tr>
<tr>
<td width="64">Mobil</td>
<td align=right width="236"><input type="text" name="mobil" size="32" value="<%=rs("mobil")%>"></td>
</tr>
<tr>
<td width="64">Email</td>
<td align=right width="236"><input type="text" name="email" size="32" value="<%=rs("email")%>"></td>
</tr>
<tr>
<td width="64">Opgaver</td>
<td align=right width="236"><textarea rows="12" name="opgaver" cols="28"><%=rs("opgaver")%></textarea></td>
</tr>
<tr>
<td colspan=2 width="310"><Div Align=right><Input type="submit" Value="Ret"></div>
</td>
</tr>
<input type="hidden" name="id" value="<%=Id%>">
</form>
</table>
<%
End If
End If
%>
</BODY>
</HTML>