<% ON ERROR RESUME NEXT Oper = request.querystring("Op") if Oper ="first" then Nme = request.form("TXTname") else Nme = request.querystring("LNme") end if 'response.write Nme Pwd = request.form("TXTpwd") '--------Initiliasing variables------------------- Dim AdoCon Dim RsSearch Dim SQLProj Dim RsPrc Dim SQLPrc Dim i session("logN") '------Create Connection----------------------------------- Set AdoCon = server.createobject("ADODB.CONNECTION") AdoCon.Open "Driver={MICROSOFT ACCESS DRIVER (*.mdb)};DBQ=" & server.mappath("/DB/fh.mdb") Set RsLog = server.createobject("ADODB.RECORDSET") Set RsSearch = server.createobject("ADODB.RECORDSET") '--------------- SQL Statements ------------------- SQLLog = "select * from saleslogin where SalesPersonName='" & Nme & "' AND SPassword='" & Pwd &"'" SQLSearch = "select * from enquiries where assignedto='" & Nme &"' order by enquirydate DESC" 'response.write SQLSearch '---------------------------------------------------------------- RsLog.Open SQLLog,AdoCon,3,3 response.write "Welcome : " response.write Nme '-------------------------------------- i = RsLog.recordcount 'response.write i if session("logN") = True then i = 1 end if if i < 1 then response.write "Login Failed Please try again" response.end end if RsSearch.Open SQLSearch,AdoCon,3,3 session("logN")= true %> View all enquiries|

<%DO WHILE NOT RsSearch.EOF%> "> <%RsSearch.MOVENEXT LOOP %>
Salesperson

View all enquiries

   
subject name country phone email Date Status
 <%=RsSearch("subject")%>  <%=RsSearch("Cname")%>  <%=RsSearch("country")%>  <%=RsSearch("phone")%>  <%=RsSearch("email")%>  <%=RsSearch("enquirydate")%>  <%=RsSearch("enquirystatus")%>
<% RsSearch.Close Set RsSearch=Nothing AdoCon.Close Set AdoCon=Nothing%>