banner literature about projects tools meetings search links BBS GAP home GAP home
home
<% SearchType = GetInput("SearchType") SearchScope = GetInput("SearchScope") SearchPhrase = GetInput("SearchPhrase") If (SearchType = "") OR (SearchScope = "") OR (SearchPhrase = "") Then Response.Write("This section is searchable by Contact Last Name, Institution, Keyword, or Country.") Call DrawForm() Else Call DrawForm() Call Search() Call DrawForm() End If Sub DrawForm() Response.Write("
") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("
") End Sub Sub Search() Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open Application("DSN_International") Select Case SearchScope Case 1 Select Case SearchType Case "Keyword" Set RS = Conn.Execute("EXEC spSearchKeywords '%" & SearchPhrase & "%'") Case "Contact Last Name" Set RS = Conn.Execute("EXEC spSearchLastNames '%" & SearchPhrase & "%'") Case "Institution" Set RS = Conn.Execute("EXEC spSearchInstitutions '%" & SearchPhrase & "%'") Case "Country" Set RS = Conn.Execute("EXEC spSearchCountries '%" & SearchPhrase & "%'") End Select Case Else Select Case SearchType Case "Keyword" Set RS = Conn.Execute("EXEC spSearchKeywords '" & SearchPhrase & "'") Case "Contact Last Name" Set RS = Conn.Execute("EXEC spSearchLastNames '" & SearchPhrase & "'") Case "Institution" Set RS = Conn.Execute("EXEC spSearchInstitutions '" & SearchPhrase & "'") Case "Country" Set RS = Conn.Execute("EXEC spSearchCountries '" & SearchPhrase & "'") End Select End Select If Not RS.EOF Then Response.Write("Below are the matches for your search. Click on one to get more detail.") Response.Write("") Else Response.Write("No matches were found. Try to revise your search or use the browse function to manually search.") End If End Sub Private Function SQLEncode(SQLEncodeValue) For LCV = 1 to Len(SQLEncodeValue) Select Case Mid(SQLEncodeValue, LCV, 1) Case "'" SQLEncode = SQLEncode & "'" SQLEncode = SQLEncode & Mid(SQLEncodeValue, LCV, 1) Case Else SQLEncode = SQLEncode & Mid(SQLEncodeValue, LCV, 1) End Select Next End Function Private Function InsertValue(Value) If Value = "" Then InsertValue = "" Else InsertValue = " VALUE=""" & Server.HTMLEncode(Value) & """" End If End Function Private Function InsertSelected(Value1, Value2) If Value1 <> Value2 Then InsertSelected = "" Else InsertSelected = " SELECTED" End If End Function Private Function GetInput(Variable) GetInput = Trim(Request.Form(Variable)) If Trim(Request.QueryString(Variable)) <> "" Then GetInput = Trim(Request.QueryString(Variable)) End If End Function %>

 

Literature  | About GAP | Projects and Products | Tools | Meetings | SearchLinks | Bulletin Boards  |  Site Map

 

USGS  ||Gap Analysis Program || NBII ||
Disclaimer
|| Privacy || Accessibility||
GAP Webmaster ||