%
fname = Request("firstname")
lname = Request("lastname")
depart = Request("department")
sortby = Request("SortBy")
Dim objConn
Dim objRec
Dim strConn
Dim count
TheSQL = "SELECT FNAME, LNAME, EXTENSION, EMAIL, DEPTNAME FROM Employee WHERE FNAME like '" & fname & "%' and LNAME LIKE '" & lname & "%' and DEPTNAME LIKE '" & depart & "%' ORDER BY DEPTNAME;"
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRec = Server.CreateObject("ADODB.Recordset")
objConn.Open strConnect
%>
|
|
|
Enter your search string in the textbox(es)
<%
if Request.Form("SUBMIT1") <> "" Then
objRec.Open TheSQL, objConn
%>
The search string you entered for FirstName is :<%=fname %> ,LastName is :<%=lname %>, Department is:<%=depart %>
and you're sorting by:<%=sortby %>
<%
while Not objRec.EOF
count = count + 1
Response.Write ""
Response.Write "" &""& objRec("FNAME") & " | " & objRec("LNAME") & " | " & objRec("EXTENSION") &" | " & objRec("EMAIL") & " | " & objRec("DEPTNAME") & " "
Response.Write " | "
objRec.MoveNext
Wend
End If
%>
Number of records found : <%Response.write count %>
<%
'objRec.Close
set objRec = Nothing
%>
|
|
|