![]() |
VBScript Sample: vbscript/ado/studentreg/register.asp |
|
||||||
|
||||||||
<html>
<head>
<title></title>
</head>
<body BGCOLOR="#eadfdf">
<font face="Verdana, arial, helvetica">
<%
Dim lastname
Dim firstname
Dim email
Dim company
Dim coursee
Dim courseexpectations
Dim courselocation
Dim courseTitle
Dim coursestartdate
Set conn = Server.CreateObject("ADODB.CONNECTION")
conn.Open "DSN=studentdatabase;UID=;PWD=;"
lastname = Request.Form("LastName")
firstname = Request.Form("FirstName")
email = Request.Form("Email")
company = Request.Form("Company")
courseexpectations = Request.Form("TEXTAREA1")
courselocation = Request.Form("CourseLocation")
courseTitle = Request.Form("CourseTitle")
coursestartdate = Request.Form("courstStartDate")
Set rset = Server.CreateObject("ADODB.RECORDSET")
'conn.execute("select * from Students")
rset.CursorType = 2
rset.LockType = 2
rset.Open "Students", conn
rset.MoveLast
Set stufields = rset.Fields
rset.AddNew
stufields.Item(1).Value = lastname
stufields.Item(2).Value = firstname
stufields.Item(3).Value = email
stufields.Item(4).Value = company
stufields.Item(5).Value = courseTitle
stufields.Item(6).Value = courselocation
stufields.Item(7).Value = coursestartdate
stufields.Item(8).Value = courseexpectations
rset.Update
rset.Close()
conn.Close
response.write("<html><head><title>Confirmation Page</title></head>")
response.write("  ")
response.write("<font face=1,2,3 size=4>The following information was entered successfully:</font>")
response.write("<p>")
response.write("<li><B>Name:</B> " + lastName + ", " + firstName)
response.write("<li><B>E-mail:</B> " + email)
response.write("<li><B>Company:</B> " + company )
response.write("<li><B>Course Expectations:</B> " + CourseExpectations)
response.write("<li><B>Course Title:</B> " + courseTitle)
response.write("<li><B>Course Location:</B> " + courseLocation)
response.write("<li><B>Course Start Date:</B> " + CourseStartDate)
%>
<p><a href="studentindex.html"><font size="3" color="#0000ff">-----Return-----</font> </p>
</a></font>
</body>
</html>
|
||||||||
|
||||||||
Copyright © 1998-2002, Halcyon
Software Inc. All rights reserved.
|