SQL UPDATE Query - Syntax error
Får en skide syntax error på min SQL query.. jeg har prøvet at smide den i access og der kører den fint så jeg ved sku ik hva der er galt her.. nogen der ka se noget?If Request.QueryString("mode") = "ret" Then
If Request.Form("knap") = "OK" then
username = Request.Form("username")
username = Replace(username, "'", "''")
username = Replace(username, "<", "<")
username = Replace(username, ">", ">")
password = Request.Form("password")
password = Replace(password, "'", "''")
password = Replace(password, "<", "<")
password = Replace(password, ">", ">")
email = Request.Form("email")
email = Replace(email, "'", "''")
email = Replace(email, "<", "<")
email = Replace(email, ">", ">")
lvl = Request.Form("lvl")
lvl = Replace(lvl, "'", "''")
lvl = Replace(lvl, "<", "<")
lvl = Replace(lvl, ">", ">")
id = Request.Form("id")
Set Con = Server.CreateObject ("ADODB.Connection")
Con.open strCon
strSQL="UPDATE Users SET username='" & username & "', password='" & password & "', email='" & email & "', lvl='" & lvl & "' WHERE ID="&id
Con.Execute(strSQL)
Con.Close
Response.Buffer=true
Response.Clear
Response.Redirect "users.asp"
response.end
else
Set Con = Server.CreateObject ("ADODB.Connection")
Con.open strCon
strSQL="SELECT * FROM Users WHERE ID="&Request("id")
Set rs = Con.Execute(strSQL)
End If
%>
<table cellspacing=1 width=690 align=center bgColor=black>
<tr>
<td class="heading" width="570"><b>Edit <%=rs("username")%></b></td>
</tr>
<tr>
<td class=content>
<form method="post" action="<%=rootdir%>/members/users.asp?mode=ret">
<table border="0" cellpadding="2" cellspacing="1">
<tr>
<td width="50%"></td>
<td width="50%"></td>
</tr>
<tr>
<td width="50%"><span>Brugernavn:</span></td>
<td width="50%"><input type="text" name="username" value="<%=rs("username")%>" maxlength="100" size="20"></td>
</tr>
<tr>
<td width="50%"><span>Password:</span></td>
<td width="50%"><input type="password" name="password" value="<%=rs("password")%>" maxlength="100" size="20"></td>
</tr>
<tr>
<td width="50%"><span>E-Mail:</span></td>
<td width="50%"><input type="text" name="email" value="<%=rs("email")%>" maxlength="100" size="20"></td>
</tr>
<tr>
<td width="50%"><span>Level:</span></td>
<td width="50%">
<select size="1" name="lvl">
<%
Response.Write("<option selected>" & rs("lvl") & "</option>")
%>
<option>member</option>
<option>news</option>
<option>admin</option>
</select></span>
</td>
</tr>
</table>
<input type="hidden" name="id" value="<%=rs("id")%>">
<input type="hidden" name="mode" value="ret">
<input type="submit" value="OK" name="knap"><input type="reset" value="Reset">
</form>
</td>
</tr>
</table>
<img height=12 src="<%=rootdir%>/images/pixel.gif" width=16><br>
<%
con.Close
set con = Nothing
End If %>