Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
3.4 KiB

  1. <HTML>
  2. <HEAD>
  3. <TITLE>Query Results from OLE DB Provider for Indexing Service</TITLE>
  4. <LINK REL=STYLESHEET HREF="is2style.css" TYPE="text/css">
  5. </HEAD>
  6. <BODY BGCOLOR=#FFFFFF>
  7. <TABLE>
  8. <TR><TD><A HREF="http://www.microsoft.com/ntserver/search" target="_top"><IMG SRC ="is2logo.gif" VALIGN=MIDDLE ALIGN=LEFT border=0></a></TD></TR>
  9. <TR><TD ALIGN="RIGHT"><H3>Simple SQL Search Results</H3></TD></TR>
  10. </TABLE>
  11. <P>
  12. <%' !--#INCLUDE VIRTUAL="/iissamples/issamples/ADOVBS.INC"--%>
  13. <%
  14. QueryForm = "/iissamples/issamples/sqlqhit.htm"
  15. Set Conn = Server.CreateObject("ADODB.Connection")
  16. Conn.ConnectionString = "provider=msidxs;"
  17. Conn.Open
  18. Set AdoCommand = Server.CreateObject("ADODB.Command")
  19. set AdoCommand.ActiveConnection = Conn
  20. %>
  21. Executing the following query:
  22. <% if Request.QueryString("CiRestriction")="" then %>
  23. <% if Request.QueryString("CiOrderBy")="" then %>
  24. <% AdoCommand.CommandText = "Select "&Request.QueryString("CiColumns")&" from " &Request.QueryString("CiScope") %>
  25. <% else %>
  26. <% AdoCommand.CommandText = "Select "&Request.QueryString("CiColumns")&" FROM " &Request.QueryString("CiScope")&" ORDER BY " &Request.QueryString("CiOrderBy") %>
  27. <% end if %>
  28. <% else %>
  29. <% if Request.QueryString("CiOrderBy")="" then %>
  30. <% AdoCommand.CommandText = "Select "&Request.QueryString("CiColumns")&" from " &Request.QueryString("CiScope")&" where "&Request.QueryString("CiRestriction") %>
  31. <% else %>
  32. <% AdoCommand.CommandText = "Select "&Request.QueryString("CiColumns")&" FROM " &Request.QueryString("CiScope")&" WHERE "&Request.QueryString("CiRestriction")&" ORDER BY " &Request.QueryString("CiOrderBy") %>
  33. <% end if %>
  34. <% end if%>
  35. <P><I><%=AdoCommand.CommandText%></I>
  36. <%
  37. Set RS = Server.CreateObject("ADODB.RecordSet")
  38. AdoCommand.Properties("Bookmarkable") = True
  39. RS.CursorType = adOpenKeyset
  40. RS.MaxRecords = 300
  41. RS.open AdoCommand
  42. CiSearchString = CStr(RS.Properties("Query Restriction"))
  43. %>
  44. <P>
  45. <TABLE BORDER=1>
  46. <TR>
  47. <% For i = 0 to RS.Fields.Count - 1 %>
  48. <TH class=RecordTitle><B><% = RS(i).Name %></B></TH>
  49. <% Next %>
  50. </TR>
  51. <% Do While Not RS.EOF %>
  52. <TR>
  53. <% For i = 0 to RS.Fields.Count - 1 %>
  54. <%if RS(i).Name = "PATH" or RS(i).Name="VPATH" then %>
  55. <%if RS(i).Name="VPATH" and CiSearchString <> "" then %>
  56. <%
  57. ' Construct the URL for hit highlighting
  58. WebHitsQuery = "CiWebHitsFile=" & Server.URLEncode( RS("vpath") )
  59. WebHitsQuery = WebHitsQuery & "&CiRestriction=" & Server.URLEncode( CiSearchString )
  60. WebHitsQuery = WebHitsQuery & "&CiBeginHilite=" & Server.URLEncode( "<b class=Hit>" )
  61. WebHitsQuery = WebHitsQuery & "&CiEndHilite=" & Server.URLEncode( "</b>" )
  62. WebHitsQuery = WebHitsQuery & "&CiUserParam3=" & QueryForm
  63. ' WebHitsQuery = WebHitsQuery & "&CiLocale=" & Q.LocaleID
  64. %>
  65. <TD>
  66. <TABLE>
  67. <TR><TD><b><a href="<%=RS(i)%>"><% = RS(i) %></a></b></TD></TR>
  68. <TR NOWRAP><TD><I>
  69. Hit Highlighting:<br>
  70. <a href="qsumrhit.htw?<%= WebHitsQuery %>"><IMG src="hilight.gif" align=left alt="Highlight matching terms in document using Summary mode."> Summary</a><br>
  71. <a href="qfullhit.htw?<%= WebHitsQuery %>&CiHiliteType=Full"><IMG src="hilight.gif" align=left alt="Highlight matching terms in document."> Full</a>
  72. </I></TD></TR>
  73. </TABLE>
  74. <%else%>
  75. <TD><b><a href="<%=RS(i)%>"><% = RS(i) %></a></b></TD>
  76. <%end if%>
  77. <%else%>
  78. <TD><% = RS(i) %></TD>
  79. <%end if%>
  80. <% Next %>
  81. </TR>
  82. <%
  83. RS.MoveNext
  84. Loop
  85. RS.Close
  86. Conn.Close
  87. %>
  88. </TABLE>
  89. <!--#include file ="is2foot.inc"-->
  90. </BODY>
  91. </HTML>