Suppose your table name was myTable.
Then with your fields:
name (gonna shorten it for typeing here, but is the same thing as student_name)
userID
pwd (short for password)
dept (short for department)
yr
email (reformatted name for E-mail)
Suppose on a form from the last page you had the user input this data, like so:
page1.html
--------------
<form action='page2.asp' method='post'>
Name: <input type='text' name='name'><BR>
ID: <input type='text' name='id'><BR>
Password: <input type='text' name='pwd'><BR>
Department: <input type='text' name='dept'><BR>
Year: <input type='text' name='yr'><BR>
Email Addr: <input type='text' name='email'><BR>
<input type='submit' value='Submit Information'><BR>
</Form>
It doesn't matter what you name each field here because that's just the name of the element on the form of the page taking the inforamtion, you'll pull this info on the next page and assign it to your variables.
Remember on the next page, it doesn't matter what your variables are named, just as long as you know what name is what data. And remember to put your actual database field names in the insert statement rather than my shortened ones for this quick description/lesson.
page2.asp
----------
<% @ Language=VBScript%>
<% Option Explicit
Dim myName, myUserID, myPwd, myDept, myYr, myEmail, sql
myName = Request.Form("name"
myUserID = Request.Form("id"
myPwd = Request.Form("pwd"
myDept = Request.Form("dept"
myYr = Request.Form("yr"
myEmail = Request.Form("email"
sql = "INSERT INTO myTable (name, userID, pwd, dept, yr, email) VALUES ('" & myName & "', '" & myUserID & "', '" & myPwd & "', '" & myDept & "', '" & myYr & "', '" & myEmail & "');"
Dim conn, rs, DSNtemp
Set conn = Server.CreateObject("ADODB.Connection"
Set rs = Server.CreateObject("ADODB.Recordset"
DSNtemp = "DRIVER={Microsoft Access Driver (*.mdb)};"
DSNtemp = DSNtemp & "DBQ=C:\Inetpub\conn.Open DSNtemp
conn.Execute(sql)
conn.Close
Set conn = nothing
Response.redirect("page1.html"
%>
just change the field names listed in the sql statement (name, userID, pwd, etc etc) to the actual names of the fields in your database, change the DBQ line in the DSNtemp variable to the actual location of your database on the hard drive (c:\Inetpub\
etc) and then copy this code into the two pages and them them accordingly (page1.html, & page2.asp) and you should have a working site, quick and simple. That'll show you how it works. (also, don't forget to change the name "myTable" in the sql statement to the actual name of your database.
So
1) change the name of the database in the sql statement.
2) change the names of the fields in the sql statement to your names.
3) change the location of the database in the DBQ line of the DSNtemp variable to the location of your database on your harddrive.
4) create two pages, page1.html and page2.asp and copy the coresponding code I have displayed here with your alterations into each of those pages, then run them. You'll see them work. Then you'll see how the insert into (append) statement works.
Does this make sense?
-Ovatvvon :-Q