<%
count = 0
sSQL = "select subscriberid, firstname, lastname, company, emailaddress, status, lastupdate from subscribers where "
if Request.QueryString("sFirstName") <> "" then
sSQL = sSQL & "firstname like '" & Request.QueryString("sFirstName") & "' "
count = count + 1
end if
if Request.QueryString("sLastName") <> "" then
if count > 0 then
sSQL = sSQL & "and "
end if
sSQL = sSQL & "lastname like '" & Request.QueryString("sLastName") & "' "
count = count + 1
end if
if Request.QueryString("sCompany") <> "" then
if count > 0 then
sSQL = sSQL & "and "
end if
sSQL = sSQL & "Company like '" & Request.QueryString("sCompany") & "' "
count = count + 1
end if
if Request.QueryString("sPhoneNumber") <> "" then
if count > 0 then
sSQL = sSQL & "and "
end if
sSQL = sSQL & "phonenumber like '" & Request.QueryString("sPhoneNumber") & "' "
count = count + 1
end if
if Request.QueryString("sFaxNumber") <> "" then
if count > 0 then
sSQL = sSQL & "and "
end if
sSQL = sSQL & "faxNumber like '" & Request.QueryString("sFaxNumber") & "' "
count = count + 1
end if
if Request.QueryString("sEmailAddress") <> "" then
if count > 0 then
sSQL = sSQL & "and "
end if
sSQL = sSQL & "emailaddress like '" & Request.QueryString("sEmailAddress") & "' "
count = count + 1
end if
if Request.QueryString("sAddressLine1") <> "" then
if count > 0 then
sSQL = sSQL & "and "
end if
sSQL = sSQL & "addressline1 like '" & Request.QueryString("sAddressLine1") & "' "
count = count + 1
end if
if Request.QueryString("sAddressLine2") <> "" then
if count > 0 then
sSQL = sSQL & "and "
end if
sSQL = sSQL & "addressline2 like '" & Request.QueryString("sAddressLine2") & "' "
count = count + 1
end if
if Request.QueryString("sCity") <> "" then
if count > 0 then
sSQL = sSQL & "and "
end if
sSQL = sSQL & "city like '" & Request.QueryString("sCity") & "' "
count = count + 1
end if
if Request.QueryString("sState") <> "" then
if count > 0 then
sSQL = sSQL & "and "
end if
sSQL = sSQL & "state like '" & Request.QueryString("sState") & "' "
count = count + 1
end if
if Request.QueryString("sZipCode") <> "" then
if count > 0 then
sSQL = sSQL & "and "
end if
sSQL = sSQL & "zipcode like '" & Request.QueryString("sZipCode") & "' "
count = count + 1
end if
if Request.QueryString("sCountry") <> "" then
if count > 0 then
sSQL = sSQL & "and "
end if
sSQL = sSQL & "country like '" & Request.QueryString("sCountry") & "' "
count = count + 1
end if
%>
<%
set oRs1 = Server.CreateObject("ADODB.Recordset")
oRs1.Open sSQL, oConn, 3, 3
%>