<% Response.buffer="true"%> <% '********************************************************************** ' Get and check the variables that is passed to the script '********************************************************************** SearchString1=Request.Form("SearchString1") 'SearchString2=Request.Form("SearchString2") 'SearchString3=Request.Form("SearchString3") Sforf ="TblHoved.Hovedpost LIKE '%" & SearchString1 & "%' AND " 'Stittel ="Opplag.Tittel LIKE '%" & SearchString2 & "%' AND " 'Semneord ="Opplag.Emneord LIKE '%" & SearchString3 & "%' AND " If SearchString1<> "" Then SelectExtra = SelectExtra & Sforf End If 'If SearchString2<>"" Then ' SelectExtra = SelectExtra & Stittel 'End If 'If SearchString3<>"" Then ' SelectExtra = SelectExtra & Semneord 'End If If SearchString1="" Then 'AND SearchString2="" AND SearchString3="" Response.Write ("Hallo, det hadde kanskje vore ein idê å fylt ut eit felt eller to") ingenting=1 Else SelectExtra = SelectExtra & "1" End If '***************************************************************************** Function ReplaceTest(streng, patrn, replStr) Dim regEx ' Create variables. Set regEx = New RegExp ' Create regular expression. regEx.Pattern = patrn ' Set pattern. regEx.IgnoreCase = True ' Make case insensitive. ReplaceTest = regEx.Replace(str1, replStr) ' Make replacement. Response.Write(ReplaceTest) End Function '********************************************************************** ' Main script begins here '********************************************************************** 'let us calculate the time spent Set X = Server.CreateObject("ASPTime.Time") ' Start the stop-clock X.Start() Sub cmdPrintElement (lcForfatter, lcURL, lcSearchString1) Dim objRegExp Set objRegExp = New RegExp objRegExp.IgnoreCase = True objRegExp.Global = True If lcSearchString1<>"" then 'Replace all instances of FoundSearchWord with FoundSearchWord objRegExp.Pattern = "(" & lcSearchString1 & ")" lcforfatter = objRegExp.Replace(lcforfatter, "$1") End If 'If lcSearchString2<>"" then 'Replace all instances of FoundSearchWord with FoundSearchWord 'objRegExp.Pattern = "(" & lcSearchString2 & ")" 'lctittel = objRegExp.Replace(lctittel, "$1") 'End If 'If lcSearchString3<>"" then ' 'Replace all instances of FoundSearchWord with FoundSearchWord ' objRegExp.Pattern = "(" & lcSearchString3 & ")" ' lcautonummer = objRegExp.Replace(lcautonummer, "$1") 'End If Set objRegExp = Nothing 'Clean up! %>

University of Bergen : University Library : Law Library  

Search Results:

<%=lcForfatter%> Link - OPAC  
<% End Sub %> <% if ingenting<>1 THEN set SearchNorLaw=Updb.execute("Select * from TblHoved WHERE ("&SelectExtra&") ORDER BY TblHoved.ID") %> <% ' Now lets grab all the records Do while not SearchNorLaw.EOF %> <% call cmdPrintElement (SearchNorLaw("Hovedpost"), SearchNorLaw("URL"), SearchString1) %> <%howmanyrecs=howmanyrecs+1%> <% SearchNorLaw.movenext loop %>
 
<% X.Stop() %> <% if howmanyrecs=0 and SearchString1 <> "dummydummy" then %> Sorry, your search yielded no matching results
<% elseif SearchString1 <> "dummydummy" then %> Total number of hits: <%=howmanyrecs%>
<% end if %>


<% 'cleanup SearchNorLaw.close set SearchNorLaw=nothing Updb.close set Updb=nothing Else End If %>