Back to
the Source Listing
<!--#include
file="includes/FacConn.inc"-->
<%
'Developer: Angela Johnston
'Date: February 10, 2002
'
'addProfessional.asp - This page
enters the information from the form in editProfessional.asp
' into the faculty database.
'
'***************************************************************************************************************
'Included pages
' FacConn.inc - Checks whether
the user has application priviledges
' formStyle.css - The style sheet
for the Faculty Application
' adovbs.inc - A page usually
included with ASP to make openning tables and running queries easier.
' It assigns names to numbers, so
that you don't have to remember what each number means.
'
'QueryStrings (name - value)
' None
'
'Recordsets (name - value)
' rsUser - (FacConn.inc) contains
the current user logged on to the intranet (tblUser)
' rsFac - contains the current
faculty member's information (tblFaculty)
'
'Variables
' strSQL - (FacConn.inc) use to
store the sql string for a query
' bAdmin - (FacConn.inc) boolean
value, "True" if user is an Administrator, "False" if the
user is not
' lngUserID - (FacConn.inc) the
ID number for the current user
' strUserLogon - (FacConn.inc)
the Logon Name for the current user
' lngFacID - the ID number for
the current faculty member
'
'
'Form Fields
' BS - a text box for the faculty
member's name
' MS - a text box for the faculty
member's title or position
' PhD - a text box for the
faculty member's office number
' ResearchInterest - a textarea
box for the faculty member's research interests
' Honors - a textarea box for the
faculty member's Honors
'
'***************************************************************************************************************
%>
<%
Dim rsFac
Dim lngFacID
If bAdmin = "True" Then
lngFacID = Session("FacID")
'Open a recordset containing the
current faculty member using the variable lngUserID
Set rsFac =
Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM
tblFaculty WHERE fldFacID = " & lngFacID & ";"
rsFac.Open strSQL, fp_conn,
adOpenDynamic, adLockOptimistic, adCmdText
Else
'Open a recordset containing the
current faculty member using the variable lngUserID
Set rsFac =
Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM
tblFaculty WHERE fldUserID = " & lngUserID & ";"
rsFac.Open strSQL, fp_conn,
adOpenDynamic, adLockOptimistic, adCmdText
End If
If Not rsFac.EOF Then
'Update faculty information
rsFac("fldBS") =
Request.Form("BS")
rsFac("fldMS") =
Request.Form("MS")
rsFac("fldPhD") =
Request.Form("PhD")
rsFac("fldResearchInterest")
= Request.Form("ResearchInterest")
rsFac("fldHonors") =
Request.Form("Honors")
rsFac("fldTimeStamp") =
Now
rsFac.Update
End If
rsFac.Close
Response.Redirect "professionalConfirmation.asp"
%>