Internet Security Reference

Space & Depth Database

<% local_ip = "209.30.18.137" 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 or Keyblank 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 "addr" 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")="SpaceD - 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 if srch_type <> "Details" AND srch_type <> "Update_Record" then SQLQuery = "SELECT * FROM drctdat WHERE " If srch_type <> "First" Then For i = 1 to Num_brf_wrds SQLQuery = SQLQuery & "UCASE(mfg_name) 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(mfg_name) LIKE '" & keyw_search & "%'" End IF SQLQuery = SQLQuery & " ORDER BY mfg_name" Set RS = Conn.Execute(SQLQuery) if Request.ServerVariables("REMOTE_ADDR")= local_ip then Response.Write(SQLQuery) End If %>

<% 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 %> <%End if%> <% RS.MoveNext Loop %>
<%=RS(0).Name%> <%=RS(1).Name%> <%=RS(2).Name%>
<%Response.Write("") %> <%Response.Write("") %>

<%=RS(1)%> <%=RS(2)%>
<% RS.Close Conn.Close ' 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%> <%'the next end statement is for the above <> "Details" END IF%> <% if srch_type = "Details" then ' Do the detailed thang ... get the selected records fields SQLQuery = "SELECT * FROM drctdat WHERE UCASE(mfg_name) = '" & keyw_search & "'" Set RS = Conn.Execute(SQLQuery)%>

<%=RS(0).Name%>:               
<%=RS(1).Name%>:               
<%=RS(2).Name%>:               
<%=RS(3).Name%>:               
<%=RS(4).Name%>:               
<%=RS(5).Name%>:               
Space Depth
0 .
1
2
3
4
5
6
7
8
9
10
11
12
<% ' you could alos test here for a specific logon user name if Request.ServerVariables("REMOTE_ADDR")= local_ip then ' only allow update button if user is from local connection Response.Write("") %> <%Response.Write("") %>

<%End If%> <% RS.Close conn.Close End If ' This end is for the <> "Details" %> <%IF srch_type = "Update_Record" then SQLQuery = "SELECT * FROM drctdat WHERE UCASE(mfg_name) = '" & keyw_search & "'" Set RS = Conn.Execute(SQLQuery)%> <% if Request.ServerVariables("REMOTE_ADDR")= local_ip then Response.Write(SQLQuery) End If %> <%SQLQuery = "UPDATE drctdate SET " for i = 0 to 28 if i < 28 then SQLQUERY = SQLQUERY & RS(i).Name & " = '" & Request.Form(RS(i).name) & "', " else SQLQUERY = SQLQUERY & RS(i).Name & " = '" & Request.Form(RS(i).name) & "' " end if next SQLQuery = SQLQUERY & "WHERE UCASE(mfg_name) = '" & keyw_search & "'" Set RS = Conn.Execute(SQLQuery) RS.Close Conn.Close %> <%= SQLQuery %> <%END IF%> <%End IF ' This is for the very first If srch_type = "" %>