<% Option Explicit response.buffer = true %> Glossary
Updated
CISR > Resource Library > Glossary > Glossary Results
Glossary
<% dim admin, Words Words = request.form("Words") %> Search | Browse Most Recent <% if Session("LOGGEDIN") then %> <% end if %>

Sources:
1 - Glossary of UN Peacekeeping Terms
2 - Hidden Killers 1994: The Global Landmine Crisis
3 - Hidden Killers 1998: The Global Landmine Crisis
4 - International Standards for Humanitarian Mine Clearance Operations (1999)
5 - International Mine Action Standards (IMAS) 4.10 Glossary Edition 1
6 - North Atlantic Treaty Organization Definition
7 - UNEXPLODED ORDNANCE (UXO) An Overview.
8 - U.S. Government Humanitarian Demining Strategic Plan, May 1997
<% dim tempString, sql, stringArray, i sql = "SELECT * FROM Master WHERE " if words = "AND" then sql = sql & "ID LIKE '%" for i=0 to UBOUND(stringArray) sql = sql & stringArray(i) if i <> UBOUND(stringArray) then sql = sql & " " next sql = sql & "%' OR Term LIKE '%" for i=0 to UBOUND(stringArray) sql = sql & stringArray(i) if i <> UBOUND(stringArray) then sql = sql & " " next sql = sql & "%' OR Definition LIKE '%" for i=0 to UBOUND(stringArray) sql = sql & stringArray(i) if i <> UBOUND(stringArray) then sql = sql & " " next sql = sql & "%'" else for i=0 to UBOUND(stringArray) sql = sql & "ID LIKE '" & stringArray(i) & "' OR " sql = sql & "Term LIKE '%" & stringArray(i) & "%' OR " sql = sql & "Definition LIKE '%" & stringArray(i) & "%' " if NOT i = UBOUND(stringArray) then sql = sql & " " & Words & " " end if if i <> UBOUND(stringArray) then sql = sql & "OR " next end if sql = sql & " ORDER BY Term" const connectionStr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=d:\inetpub\databases\glossary.mdb" dim conn Set conn = Server.CreateObject("ADODB.Connection") conn.Open connectionStr dim rs set rs=Server.CreateObject("ADODB.RecordSet") rs.Open sql, conn, 1, 3 %>
<% '-------------------------------Start of Bookmarks---------------------------------------- dim intCol, intRow, Array, length, switch, reBold, wordstohighlight dim x, y, temp, temp2, z 'These variables are used only to create the bookmark links at the top of the list. There is 'another set after this section to create the actual list of items. dim b, c, bookmark, bookmark2 switch = false Array = rs.GetRows intCol = 2 intRow = rs.RecordCount intRow = intRow-1 %>
Index: <% for b=0 to intRow 'This IF section is testing the first letter of the acronym in the current and next record 'to determine if the length changes so it can indicate to write the bookmark bookmark (as in 'not bookmark2). if NOT b = intRow then length = len(Array(1,b)) - (len(Array(1,b))-1) bookmark = left(Array(1,b),length) c=b+1 length = len(Array(1,c)) - (len(Array(1,c))-1) bookmark2 = left(Array(1,c),length) 'Actually comparing the records and the setting the switch variable. If it is true then 'the last if/then in this section writes out the bookmark. if bookmark < bookmark2 then switch = true end if else temp = "" end if 'Writes out the header for the first level break for the beginning of the table if switch then response.write " " & bookmark2 & " " switch = false end if next response.write "
" '-------------------------------End of Bookmarks---------------------------------------- '-------------------------------Start Writing List---------------------------------------- %>
Total Records: <%=rs.recordcount%>

#
Term
Source
Definition
<% rs.movefirst if rs.BOF And rs.EOF Then response.write "No Items Found" else wordstohighlight= stringArray Set reBold= New RegExp reBold.Pattern = "(" & JOIN(wordstohighlight, "|") & ")" reBold.IgnoreCase = True reBold.Global = True Array = rs.GetRows intCol = 3 intRow = rs.RecordCount intRow = intRow-1 for y=0 to intRow 'This IF section is testing the first letter of the acronym in the current and next record 'to determine if the letter changes so it can create breaks in the table denoting such changes 'therefore creating a table that is easier to scan and search. if NOT y = intRow then length = len(Array(1,y)) length = length - (len(Array(1,y))-1) temp = Array(1,y) temp = left(temp,length) z = y+1 length = 0 length = len(Array(1,z)) length = length - (len(Array(1,z))-1) temp2 = Array(1,z) temp2 = left(temp2,length) elseif y-intRow = 0 then 'If there is only one record returned we want to print the heading row that includes the letter 'of the alphabet this record begins with. This will also prevent the application from thinking that 'we are at the end of the record set and therefore not print out the special character , which 'is used in the else statement below. length = len(Array(1,y)) length = length - (len(Array(1,y))-1) temp = Array(1,y) temp = left(temp,length) else 'If the end of the database is reached, we need to stop the application from creating a final 'break in the table, using "" as the highest value character in ASCII. I don't how to create this 'character, I don't even know what it is, so I just copied it from another website. :) temp = "" end if 'Writes out every record in the table one record at a time. %>
<% if Session("LOGGEDIN") then %> <%=array(0,y)%> <% else %> <%=array(0,y)%> <% end if %>
<% response.write reBold.Replace (Array(1,y),"$1") %>
<%=Array(2,y)%>
<% response.write reBold.Replace (Array(3,y),"$1") %>
<% 'If the IF statement above finds a change in the first letter of the acronym, we create 'a new alphabetic section with a corrosponding bookmark. if temp < temp2 then response.write "" & temp2 & " - Top" switch = false end if response.write "" next end if rs.Close rs = null conn.Close conn = null %>