home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
sau9.org
/
sau9.org.zip
/
sau9.org
/
mathapp
/
student_add.asp
< prev
next >
Wrap
Text File
|
2002-11-20
|
2KB
|
77 lines
<%@ Language=VBScript %>
<%
Response.Buffer = True
Function ChkString(string)
If string = "" Then string = " "
ChkString = Replace(string, "'", "''")
End Function
response.write "<table> <tr> <Td><Font face=tahoma size=4><h2>New Student Confirmation <br>"
response.write "</td><td> <img src=math.gif width=140></td></tr></table>"
filePath = Server.MapPath("math_proj.mdb")
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath
id= ChkString(Request.form("id"))
fname =ChkString(Request.Form("fname"))
lname=ChkString(Request.Form("lname"))
Grade=chkString(Request.Form("grade"))
password=chkString(Request.Form("password"))
idTeacher=chkString(Request.Form("idTeacher"))
'sql_update="INSERT into tblStudent INNER JOIN tblPerformance ON tblStudent.idStudent = tblPerformance.idStudent (tblStudent.idstudent, tblperformance.idstudent, tblStudent.txtFname, tblStudent.txtLName, tblStudent.txtGrade, tblStudent.pwstudent, tblStudent.teacherid) values ("
sql_update = "INSERT into tblStudent (idStudent,txtFName,txtLName, txtGrade, pwStudent, TeacherID) VALUES ("
sql_update=sql_update & id
sql_update=sql_update & ", '" & fname & "','"
sql_update=sql_update & lname & "', "
sql_update=sql_update & grade & ", '"
sql_update=sql_update & password & "',"
sql_update=sql_update & idTeacher & ")"
'response.write sql_update
response.write "<font face=tahoma>"
response.write fname & " " & lname
response.write " has been added to the database."
conn.Execute (sql_update)
conn.close
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath
sql_update2= "INSERT into tblperformance (idStudent) Values ("
sql_update2=sql_update2 & id & ")"
conn.Execute (sql_update2)
' Done. Close the connection
conn.Close
Set conn = Nothing
%>
<a href=student_admin.asp>Return </a> to view the student list.