Home > ASP Development > still working on this update problem - any ideas ?

still working on this update problem - any ideas ?



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>

    
Guest


ur calling the update function with out sending anything to it. but what u've got there is trying to make an easy operation had. the code way i gave u earlier is a far quicker way of executing the code whether ur selecting or updating the data.

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved