Hello again!,
I changed my code a little bit, but I still have the same error. I seem to run code I should not run after I hit the update button. I get a type mismatch when the code hits the data the second time around. I want my page to execute the update query when I hit "update", but it does more than that. I tried to stop it by putting in a boolean value , but it ignores it. How can I modify this code to make it work? Or should I toss it and start over? Thanks !
[code]
dim updateit
updateit = false
x = 0
if not updateit then
tempid = request.querystring("stR_id")
qstr = "select * from users where id=" & tempid
call opendb(ds,uid,pwd)
call getrec ( qstr )
response.write qstr & "qstr "
%>
<form action="edit.asp" METHOD="post">
<p> Id <input type="text" name="edit_id" value= <%=tempid%>> </p>
<% response.write data(1,0)
on error resume next%>
<p>First: <input type="text" name="edit_first" value =<%=data(1,0)%>> </p>
<p>Last : <input type="text" name="edit_last"> </p>
<p><input type="submit" name="action" value="update">
<input type="submit" name="action" value="cancel"> </p>
<% end if %>
</form>
<p>
<%
select case request.form("action")
case "update"
updateit = true
case "cancel"
updateit = false
'not sure yet -
end select
if updateit then
call updaterec( )
end if
%>
</body>
</html>
I changed my code a little bit, but I still have the same error. I seem to run code I should not run after I hit the update button. I get a type mismatch when the code hits the data the second time around. I want my page to execute the update query when I hit "update", but it does more than that. I tried to stop it by putting in a boolean value , but it ignores it. How can I modify this code to make it work? Or should I toss it and start over? Thanks !
[code]
dim updateit
updateit = false
x = 0
if not updateit then
tempid = request.querystring("stR_id")
qstr = "select * from users where id=" & tempid
call opendb(ds,uid,pwd)
call getrec ( qstr )
response.write qstr & "qstr "
%>
<form action="edit.asp" METHOD="post">
<p> Id <input type="text" name="edit_id" value= <%=tempid%>> </p>
<% response.write data(1,0)
on error resume next%>
<p>First: <input type="text" name="edit_first" value =<%=data(1,0)%>> </p>
<p>Last : <input type="text" name="edit_last"> </p>
<p><input type="submit" name="action" value="update">
<input type="submit" name="action" value="cancel"> </p>
<% end if %>
</form>
<p>
<%
select case request.form("action")
case "update"
updateit = true
case "cancel"
updateit = false
'not sure yet -
end select
if updateit then
call updaterec( )
end if
%>
</body>
</html>
