<%@ Language=VBScript %> NCC Employee Directory <% FormData = Request.Form("LastName") SearchData = FormData & "%" quot =chr(39) Const adOpenKeyset =1 Const AdlockOptimistic = 3 Set DBObj = server.CreateObject ("ADODB.Connection") Set rsDir = CreateObject ("ADODB.Recordset") strConn = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=webuser;password=ncc;Initial Catalog=NCCEmployeeDirectory;Data Source=nccsql1" DBObj.Open strConn SQLQuery = "SELECT LastName, FirstName,MI,Degree, DepartmentName, CollegeAddress, Phone, Email" SQLQuery = SQLQuery & " FROM EmailAccountView" SQLQuery = SQLQuery & " WHERE LastName Like" SQLQuery = SQLQuery & quot & SearchData & quot Set rsDir = DBObj.Execute(SQLQuery) Response.Write ("
") Response.Write ("

") Response.Write ("") Response.Write ("

") Response.Write ("") Response.Write ("") Response.Write ("NCC Employee Telephone/Email Directory") Response.Write ("
") Response.Write ("Search Results for") Response.Write (" ") Response.Write (quot) Response.Write (Formdata) Response.Write (quot) Response.Write ("

") Response.Write ("") Response.Write ("

") Response.Write ("
") Response.Write ("
") If rsDir.EOF then Response.Write ("No match found - Click the back button and refine search") Else Do Until rsDir.EOF Response.Write ("") Response.Write ("") Response.Write ("") Response.Write ("") Response.Write ("") Response.Write ("") Response.Write ("") Response.Write ("") Response.Write ("") Response.Write ("") Response.Write ("") Response.Write ("") Response.Write ("") Response.Write ("") Response.Write ("") Response.Write ("") Response.Write ("") Response.Write ("
") Response.Write ("") Response.Write ("") Response.Write ("Employee Name: ") Response.Write ("") Response.Write (" ") Response.Write Trim(rsDir.Fields("LastName")) Response.Write (",") Response.Write (" ") Response.Write rsDir.Fields("FirstName") if rsDir.Fields("Degree") <> "" then Response.Write (",") Response.Write rsDir.Fields("Degree") end if Response.Write ("") Response.Write ("
") Response.Write ("") Response.Write ("") Response.Write ("Department: ") Response.Write ("") Response.Write (" ") Response.Write rsDir.Fields("DepartmentName") Response.Write ("") Response.Write ("
") Response.Write ("") Response.Write ("") Response.Write ("College Address:") Response.Write ("") Response.Write (" ") Response.Write rsDir.Fields("CollegeAddress") Response.Write ("") Response.Write ("
") Response.Write ("") Response.Write ("") Response.Write ("On Campus Phone Number:") Response.Write ("") Response.Write (" ") Phone = rsDir.Fields("Phone") Response.Write (Phone) Response.Write ("") Response.Write ("
") Response.Write ("") Response.Write ("") Response.Write ("Off Campus Phone Number:") Response.Write (" ") Response.Write ("") offPhone = "(516)57" & phone Response.Write (offphone) Response.Write ("") Response.Write ("
") Response.Write ("") Response.Write ("") Response.Write ("Email Address:") Response.Write (" ") Response.Write ("") email = rsDir.Fields("Email") if left(email,1) = "@" then Response.Write ("No Email Address Available") Else Response.Write (email) end if Response.Write ("") Response.Write ("
") Response.Write ("
") rsDir.Movenext Loop End if rsDir.close set rsDir = nothing DBObj.close Set DBOBj = nothing %>