<html><head>
<%PageTitle="Edit existing Item"%>
<!-- #include virtual="/include/head.asp"-->
<a href="/include/code.asp?<%=Request.ServerVariables("url")%>" target=code><b>Show Code</b></a><br>
<div>This is a working page of a sample application. Please try submitting different data. See how errors are handled.</div>
<% on error resume next
Set User=server.CreateObject("DB3NF.Item")
set objSchema=User.SchemaObj 'Display functions from included display.asp need it to work
User.Class="user"

User.ID=2 'here we connect to existing item

if Request.Form.Count>1 then
	user.Form=Request.Form
	if User.Validate then
		User.SetInfo
		Msg="Info saved"
	end if
end if


%>
<p class=InfoMsg><%=msg%></p>
<form method=post id=form1 name=form1>
<table class=PropertyTable width=550 cellspacing=0>
<%
for each Prop in User.Properties
	Display Prop, Prop.Name="username" 'we don't allow to edit username
next

%>
<td colspan=2 align=CENTER class=PropertyTableSubmit>
	<input type=submit value=<%=IIF(User.ID, "Edit", "Submit")%> id=submit1 name=submit1>
</td>
</table>

</form>
<%
if err then Response.Write "<p><b>Application error</b></p>"
%>
<!-- #include virtual="/include/footer.asp"-->