PDA

View Full Version : Update isn't working again!


plasterx
12-12-2005, 02:33 AM
Hi guys, my update was working a while ago, and suddenly well, i edited the codes a little, can't remember what i removed but i'm pretty sure it was nothing important.... i think i was removing comments.but anyway my code doesn't work now!! it's not updating. can someone help? here's my codes:

edit.asp

<form method="post" action="processedit.asp">

<tr>
<!--<td><input type="hidden" value="<%=rs("SliceCode")%>" name="hidcode"></td>-->
<!--<td width="50"><input type="text" value ="<%=rs("SliceCode")%>" name="slicecode"></td>-->
<!--<td width="150" align="left"><%=rs("SliceCode")%></td>-->
<td width="150"><input type="text" value="<%=rs("SliceName")%>" name="slicename"></td>
<td width="150"><input type="file" size="8" value="<%=rs("SliceImage")%>" name="sliceimage"></td>
<td width="150"><input type="text" value="<%=rs("SliceDesc")%>" name="slicedesc"></td>
<td width="159"><input type="text" size="5" value="<%=rs("SlicePrice")%>" name="sliceprice"></td>
<td><input type="submit" value="Update"></td>
</tr>


</form>

<%
RS.MoveNext
Loop
%>
</table>


processedit.asp

Dim strhidcode
Dim strSliceCode
Dim strSliceName
Dim strSliceImage
Dim strSliceDesc
Dim strSlicePrice

Dim SQL
strTotal = Request.Form("total")
'Response.write strTotal
strhidcode = Request.Form("hidcode" )
strSliceCode = Request.Form("sliceCode")
strSliceName = Request.Form("slicename" )
strSliceImage = Request.Form("sliceImage")
strSliceDesc = Request.Form("sliceDesc" )
strSlicePrice = Request.Form("slicePrice")

'SQL = "update slicecakes set slicecode = 'Ec' where slicecode = 'haha'"

Response.write strSliceCode & "<p>"
Response.Write strhidcode

SQL = "Update SliceCakes set SliceName = '" & strSliceName & "', SliceImage = '" & strSliceImage & "', SliceDesc = '" & strSliceDesc & "', SlicePrice = '" & strSlicePrice & "' where SliceCode = '" & strhidcode & "'"

Conn.Execute SQL

Response.Write("<P>" & SQL)

Response.Redirect("edit.asp")

%>


please help me look through and see hwat's wrong? i really can't figure out. it was just working a while ago!! =(

plasterx
12-12-2005, 03:32 AM
lol i got it working already. haha. turned out that i had commented away the strhidcode. =.=