[AccessD] Using ASP to put a database on the web (Part 3)

Drew Wutka DWUTKA at Marlow.com
Fri Dec 7 18:33:24 CST 2007


Ok, we now have a more complex asp page, to display our data, and we've
added the ability to add and delete data.  Now let's make a webpage to
edit data:

Edituser.asp:

<!-- #include virtual = "dbconnect.asp" -->
<!-- #include virtual = "person.asp" -->
<%
dim pr
set pr=new Person
if request.Form("Submit")="Edit User" then
	pr.StorageOnly=False
	pr.ID=request.Form("PersonID")
	pr.FirstName=request.Form("FirstName")
	pr.LastName=request.Form("LastName")
	pr.Save
	response.Redirect "default.asp"
else
	pr.StorageOnly=False
	pr.ID=request.QueryString("PersonID")
end if%>
<html>
<body>
<form name="EditUserForm" method=post>
<input type=hidden name="PersonID" value="<%=pr.ID%>">
First Name: <input type=text size=30 name="FirstName"
value="<%=pr.FirstName%>">
<br>
Last Name: <input type=text size=30 name="LastName"
value="<%=pr.LastName%>">
<br>
<input type=submit name="Submit" value="Edit User">
</form>
</body>
</html>
<%set pr=nothing%>

All done.  If anyone needs help getting a website setup on their
machine, to test this, give a holler.  Or specific questions about the
code I posted.  I know this wasn't a huge tutorial, that's because asp
and html are big subjects, so this email was for people relatively
familiar with both, or for the first timers that want to try it out.
The new process I included was using classes within ASP.

Have a good weekend everyone.

Drew




More information about the AccessD mailing list