Internet Security Reference

Security Manufacturer Database

<% On Error Resume Next If Request.Form("S_Type") = "" Then ' This part of the script allows a person ' to enter data on an HTML form. ' If S_type is null then form is displayed, else ' the results of the search are displayed %>
<% t1="ABCDEFGHIJKLMNOPQRSTUVWXYZ" for j = 1 to 26 %> <%Next%>
<%Response.Write("")%> <%Response.Write("")%>
Manufacturer / Keywords Search!


Search Mode:

Search Tips <% ELSE ' Display results of searching database s_rec = Request.Form("s_rec") srch_type = Request.Form("S_Type") keyw_search = Ucase(Trim(Request.Form("keyw"))) If srch_type <> "First" Then 'seperate search words into array Dim keyw_words(20) i = 1 j = 1 Do While (i <= Len(keyw_search)) k = i Do While (Mid(keyw_search,k,1) <> " ") REM Response.Write(Mid(keyw_search,k,1)) k=k+1 if k > Len(keyw_search) then Exit Do End If Loop keyw_words(j) = Mid(keyw_search,i,k-i) j = j + 1 i = k + 1 Loop Num_brf_wrds = j-1 End IF Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open "MySqldtlgcDB" 'Set Conn2 = Server.CreateObject("ADODB.Connection") 'Conn2.Open "magazine" 'Set RS2 = Server.CreateObject("ADODB.RecordSet") 'Rs2.Open "log.dbf",Conn2,3,3 'RS2.AddNew 'RS2("PROGRAM")="MFG - ISR" 'RS2("KEYWORDS")=keyw_search 'RS2("USER")= Request.ServerVariables("LOGON_USER") 'RS2("IP")= Request.ServerVariables("REMOTE_ADDR") 'RS2("DATE")=date() 'RS2("TIME")=Left(time(),10) 'RS2("SRCH_MODE")=srch_type 'RS2("BROWSER")= Request.ServerVariables("HTTP_USER_AGENT") 'RS2.Update 'RS2.Close SQLQuery = "SELECT * FROM ADDRESS1 WHERE " If srch_type <> "First" Then For i = 1 to Num_brf_wrds SQLQuery = SQLQuery & "UCASE(company) LIKE '%" & keyw_words(i) & "%'" if i <> Num_brf_wrds then if srch_type = "STD" Then SQLQuery = SQLQuery & " AND " else SQLQuery = SQLQuery & " OR " END IF End If Next End If If srch_type = "First" Then SQLQuery = SQLQuery & "UCASE(company) LIKE '" & keyw_search & "%'" End IF SQLQuery = SQLQuery & " ORDER BY COMPANY" Set RS = Conn.Execute(SQLQuery) %>

<% hits =0 temp = cInt(s_rec) Do While Not RS.EOF AND hits < 15 %>
<%if temp > 0 then temp = temp - 1 Else%> <%hits=hits+1%>
Company:<%=RS(0)%>
Address:<%=RS(1)%>
Address:<%=RS(2)%>
City:<%=RS(3)%> State:<%=RS(4)%> Zip:<%=RS(5)%>
Phone:<%=RS(7)%> Fax:<%=RS(8)%>
Email:<% if RS(9) <> "" then %> <% Response.Write("" & RS(9) & "") %> <%Else%> <% Response.Write(" ")%> <%End If%>
WWW: <% if RS(10) <> "" then %> <% Response.Write("" & RS(10) & "") %> <%Else%> <% Response.Write(" ")%> <%End If%>
Notes: <%=RS(11)%>
<%End if%>

<%RS.MoveNext Loop RS.Close Conn.Close %> <% Rem if hits = 15 setup to get the rest If hits = 15 then %>

<%Response.Write("") %> <%Response.Write("") %> <%Response.Write("") %>

<%End If%> <%If hits = 0 then%> I'm sorry....nothing was found to match your request....try using different keywords, or select a different search option. Click on the BACK button to try again. <%End If%> <%End IF%>