Back to the Source Listing 

<!--#include file="includes/FacConn.inc"-->

<%
'Developer: Angela Johnston
'Date: February 5, 2002
'
'addGeneral.asp - This page takes information that the user entered on the editGeneral.asp page and
' updates the database.
'
'***************************************************************************************************************
'Included pages
' FacConn.inc - Checks whether the user has application priviledges
' 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)
' 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
'
'***************************************************************************************************************
%>
<%
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("fldName") = Request.Form("Name")
rsFac("fldPosition") = Request.Form("Position")
rsFac("fldOffice") = Request.Form("Office")
rsFac("fldPhone") = Request.Form("Phone")
rsFac("fldFax") = Request.Form("Fax")
rsFac("fldEmail") = Request.Form("Email")
rsFac("fldTimeStamp") = Now
 
rsFac.Update
End If
rsFac.Close
 
Response.Redirect "generalConfirmation.asp"
%>