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.

677 lines
20 KiB

  1. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
  2. <!--------------------------------------------------------------------------
  3. //
  4. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  5. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  6. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  7. // PARTICULAR PURPOSE.
  8. //
  9. // Copyright 1998-2000 Microsoft Corporation. All Rights Reserved.
  10. //
  11. // PROGRAM: Ciquery.htm
  12. //
  13. // PURPOSE: Illustrates use of Dynamic HTML to build a client-side
  14. // query page used to access Indexing Service.
  15. //
  16. // PLATFORM: Windows 2000
  17. //
  18. //-------------------------------------------------------------------------->
  19. <HTML>
  20. <HEAD>
  21. <TITLE>Indexing Services Dynamic HTML Sample</TITLE>
  22. <META NAME="DESCRIPTION" CONTENT="Indexing Services client-side query form">
  23. <META NAME="AUTHOR" CONTENT="Indexing Service Team">
  24. <META NAME="KEYWORDS" CONTENT="Indexing Services, query, content, hit">
  25. <META NAME="SUBJECT" CONTENT="Sample form">
  26. <META NAME="MS.CATEGORY" CONTENT="Internet">
  27. <META NAME="MS.LOCALE" CONTENT="EN-US">
  28. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
  29. <base target="_blank">
  30. </HEAD>
  31. <BODY OnLoad="Init()" LANGUAGE="VBScript">
  32. <center>
  33. <DIV ID="idTransDiv"
  34. ALIGN=CENTER
  35. STYLE="position:0; top:0; height:0; width:500; filter:revealTrans(duration=3.0, transition=5);">
  36. <H2 id="idHead" STYLE="position:0; visibility:visible; margin-bottom:0;">
  37. <font color=Blue>
  38. Indexing&nbsp;Service Query&nbsp;Form
  39. </font></H2>
  40. </DIV>
  41. </center>
  42. <br>
  43. <!-- This table contains the user-entry form. -->
  44. <div align=center>
  45. <TABLE bgcolor=ffffcc cellpadding=2 cellspacing=3 Border=3 WIDTH=400>
  46. <TR><td>
  47. <div id="QueryHeader"><b><LABEL FOR=SrchStrCtrl NAME="UserSearchString"> </LABEL></b></div>
  48. <INPUT ID="SrchStrCtrl" TYPE="TEXT" NAME="UserSearchString" SIZE="50" MAXLENGTH="100" TABINDEX=1>&nbsp;
  49. <BUTTON TYPE=SUBMIT ID="CmdGo">&nbsp;<FONT SIZE=-1>Search</FONT>&nbsp;</BUTTON>&nbsp;<br>
  50. <INPUT TYPE="RADIO" ID = StdQryButton NAME="radioQueryType" VALUE="0" checked onclick="StandardSelected()">
  51. <LABEL FOR=StdQryButton ID=StdqryButtonId> </LABEL> <br>
  52. <INPUT TYPE="RADIO" ID = AdvQryButton NAME="radioQueryType" VALUE="1" onclick="AdvancedSelected()">
  53. <LABEL FOR=AdvQryButton ID=AdvQryButtonId> </LABEL> <br>
  54. <div align=right> <A HREF="ixqlang.htm" target=_self ID=TipId> </A></div>
  55. <LABEL FOR=SortCtrl ID=SortCtrlId> <b> </b> </LABEL> <SELECT ID = SortCtrl NAME="selectSort" onchange="SortOrderSelected()">
  56. <OPTION SELECTED VALUE="Rank" ID=RankId> ?????
  57. <OPTION VALUE="DocTitle" ID=Title2Id> ?????
  58. <OPTION VALUE="Path" ID=Path2Id> ?????
  59. <OPTION VALUE="Size" ID=Size2Id> ?????
  60. <OPTION VALUE="Write" ID=Write2Id> ?????
  61. </SELECT>
  62. <LABEL FOR=OrderCtrl ID=OrderCtrlId> <b> </b> </LABEL>
  63. <SELECT ID = OrderCtrl NAME="selectOrder" onchange="SortOrderSelected()">
  64. <OPTION SELECTED VALUE="[d]" ID=DescendingId> ?????????????
  65. <OPTION VALUE="[a]" ID=AscendingId> ?????????????
  66. </SELECT>
  67. <P><table ID=idUnfiltered cellspacing=0 cellpadding=0><tr><td> <LABEL ID=UnfilteredListId> </LABEL>&nbsp;
  68. </td><td><INPUT TYPE="button" VALUE="Unfiltered Docs" ID="UnfilteredDocsId" onclick="UnfilteredSelected()"></td></table>
  69. </TD></TR>
  70. </TABLE>
  71. <p>
  72. <HR WIDTH=80% ALIGN=center SIZE=3>
  73. <p>
  74. <!-- A couple of navigation buttons, initially disabled. -->
  75. <a id=JumpPoint name="ResultPart"></a>
  76. <table width=775 ID=TopButt>
  77. <tr><td>
  78. <FORM NAME=Navigation ALIGN=RIGHT>
  79. <INPUT TYPE="BUTTON" NAME="CmdPrevious" VALUE=" ???????? ">
  80. <INPUT TYPE="BUTTON" NAME="CmdNext" VALUE=" ??????? ">
  81. </FORM>
  82. <BR>
  83. <P ID=Counter><EM> </EM>
  84. <BR>
  85. <!--
  86. -- This is the output table. Result rows will by dynamically added, but the header will
  87. -- just be hidden until needed.
  88. -->
  89. </td></td>
  90. </table>
  91. <!-- <br><INPUT TYPE="BUTTON" NAME="SortRank" VALUE="Sort by Ascending Rank"> -->
  92. <P>
  93. <TABLE bgcolor=ffffcc ID=Results COLS=3 CELLSPACING=1 CELLPADDING=3>
  94. <TR bgcolor=99cccc>
  95. <TH> <LABEL ID=SerialId> ?? </LABEL> </TH>
  96. <TH> <LABEL ID=TitleId> ??????? </LABEL> </TH>
  97. <TH> <LABEL ID=SizeId> ??????? </LABEL> </TH>
  98. <TH> <LABEL ID=ModifiedId> ????????? </LABEL> </TH>
  99. <TH> <LABEL ID=PathId> ????? </LABEL> </TH>
  100. </TR>
  101. </TABLE>
  102. <table width=775 ID=BottomButt>
  103. <tr><td>
  104. <br><br>
  105. <FORM NAME=Navigation2 ALIGN=RIGHT>
  106. <INPUT TYPE="BUTTON" NAME="CmdPrevious" VALUE=" ????????? ">
  107. <INPUT TYPE="BUTTON" NAME="CmdNext" VALUE=" ???????? ">
  108. </FORM>
  109. </td></tr>
  110. </table>
  111. </BODY>
  112. <SCRIPT LANGUAGE=VBSCRIPT>
  113. Const L_Title_Text = "Title"
  114. Const L_Size_Text = "Size"
  115. Const L_Modified_Text = "Modified"
  116. Const L_Path_Text = "Path"
  117. Const L_Rank_Text = "Rank"
  118. Const L_StdQryButton_Text = "Standard query (free text)"
  119. Const L_AdvQryButton_Text = "Advanced query"
  120. Const L_SortBy_Text = "Sort by: "
  121. Const L_OrderBy_Text = "Order by: "
  122. Const L_SearchTips_Text = "Tips for searching"
  123. Const L_Ascending_Text = "Ascending"
  124. Const L_Descending_Text = "Descending"
  125. Const L_Previous_Text = "Previous"
  126. Const L_Next_Text = "Next"
  127. Const L_UnfilteredLabel_Text = "To see a list of unfiltered documents click:"
  128. Const L_UnfilteredCmd_Text = "Unfiltered Docs"
  129. Const L_SerialNum_Text = "#"
  130. Const L_Period_Text = "."
  131. DIM RS ' The ADO Recordset. Initially null.
  132. DIM SortBy ' Current sort order
  133. DIM FirstOnPage, LastOnPage ' Keeps track of records being shown
  134. DIM MaxDisplayed ' Max number of results displayed on-screen
  135. DIM machine,catalog
  136. DIM OrigLocation
  137. DIM fUnfiltered ' Unfiltered query was requested.
  138. DIM fFreetext ' Free text query was requested
  139. '
  140. ' SubRoutine: Init
  141. '
  142. ' Synopsis: Initializes the page. Sets defaults for page-global variables
  143. ' and DHTML elements. Initially, no query is active.
  144. '
  145. Private SUB Init()
  146. ' Make the heading roll into view
  147. ' idHead.style.visibility = "hidden"
  148. ' idTransDiv.filters.item(0).apply()
  149. ' idTransDiv.filters.item(0).transition = 3
  150. ' idHead.style.visibility = "visible"
  151. ' idTransDiv.filters(0).play(1.000)
  152. UserSearchString.focus
  153. Navigation.CmdPrevious.Disabled = TRUE
  154. Navigation.CmdNext.Disabled = TRUE
  155. Navigation2.CmdPrevious.Disabled = TRUE
  156. Navigation2.CmdNext.Disabled = TRUE
  157. FirstOnPage = 0
  158. LastOnPage = 0
  159. MaxDisplayed = 25
  160. fUnfiltered = FALSE
  161. SortBy = "Rank[d]"
  162. 'Parse the catalog name out of the URL
  163. 'No need to localize "catalog", "machine" because they are hidden
  164. 'from the user.
  165. 'URL syntax is: file://<syspath>/help/ciquery.htm#machine=<machine>,catalog=<catalog>
  166. catPos = InStr(1, Document.Location.Hash, "catalog=", 1)
  167. catPos = catPos + 8
  168. 'catalog name is at the end of the string
  169. catalog = Right(Document.Location.Hash, len(Document.Location.Hash) - catPos + 1)
  170. catalog = DecodeToken(catalog)
  171. 'Parse the machine name out of the URL
  172. macPos = InStr(1, Document.Location.Hash, "machine=", 1)
  173. macPos = macPos + 8
  174. 'machine name is between "machine=" and ",catalog="
  175. commaPos = InStr(macPos, Document.Location.Hash, ",catalog", 1)
  176. machine = Mid(Document.Location.Hash, macPos, commaPos - macPos)
  177. machine = DecodeToken(machine)
  178. StdQryButtonId.InnerText = CStr(L_StdQryButton_Text)
  179. AdvQryButtonId.InnerText = CStr(L_AdvQryButton_Text)
  180. SortCtrlId.InnerText = CStr(L_SortBy_Text)
  181. OrderCtrlId.InnerText = CStr(L_OrderBy_Text)
  182. TipId.InnerText = CStr(L_SearchTips_Text)
  183. DescendingId.InnerText = CStr(L_Descending_Text)
  184. AscendingId.InnerText = CStr(L_Ascending_Text)
  185. UnfilteredListId.InnerText = CStr(L_UnfilteredLabel_Text)
  186. UnfilteredDocsId.InnerText = CStr(L_UnfilteredCmd_Text)
  187. SerialId.InnerText = CStr(L_SerialNum_Text)
  188. TitleId.InnerText = CStr(L_Title_Text)
  189. ModifiedId.InnerText = CStr(L_Modified_Text)
  190. PathId.InnerText = CStr(L_Path_Text)
  191. SizeId.InnerText = CStr(L_Size_Text)
  192. Navigation.CmdPrevious.value = CStr(L_Previous_Text)
  193. Navigation.CmdNext.value = CStr(L_Next_Text)
  194. Navigation2.CmdPrevious.value = CStr(L_Previous_Text)
  195. Navigation2.CmdNext.value = CStr(L_Next_Text)
  196. Document.All.Counter.innerHTML = CStr(L_NoResults_Text)
  197. RankId.InnerText = CStr(L_Rank_Text)
  198. Title2Id.InnerText= CStr(L_Title_Text)
  199. Path2Id.InnerText = CStr(L_Path_Text)
  200. Size2Id.InnerText = CStr(L_Size_Text)
  201. Write2Id.InnerText = CStr(L_Modified_Text)
  202. 'Check the state of buttons and init accordingly
  203. IF StdQryButton.Checked THEN
  204. call StandardSelected
  205. ELSE
  206. call AdvancedSelected
  207. end if
  208. HideTable()
  209. HideBottomButt()
  210. END SUB
  211. Const L_Freetext_Text="<LABEL FOR=SrchStrCtrl> <b>Enter your free text query below:</b> </LABEL>"
  212. Const L_Advanced_Text="<LABEL FOR=SrchStrCtrl> <b>Enter your advanced query below:</b> </LABEL>"
  213. '
  214. ' SubRoutine: StandardSelected()
  215. '
  216. ' Synopsis: Queries will be free-text
  217. '
  218. Private SUB StandardSelected()
  219. Document.All.QueryHeader.innerHTML = CStr(L_Freetext_Text)
  220. fFreetext = TRUE
  221. END SUB
  222. '
  223. ' SubRoutine: AdvancedSelected
  224. '
  225. ' Synopsis: Allows for advanced queries to be executed
  226. '
  227. Private SUB AdvancedSelected()
  228. Document.All.QueryHeader.innerHTML = CStr(L_Advanced_Text)
  229. fFreetext = FALSE
  230. END SUB
  231. '
  232. ' SubRoutine: UnfilteredSelected()
  233. '
  234. ' Synopsis: Searches for unfiltered documents
  235. '
  236. Private SUB UnfilteredSelected()
  237. fUnfiltered = TRUE
  238. CmdGo_OnClick()
  239. END SUB
  240. '
  241. ' SubRoutine: SortOrderSelected()
  242. '
  243. ' Synopsis: Sets the sort order as selected by the user
  244. '
  245. Private SUB SortOrderSelected()
  246. IF StrComp(selectSort.value, "DocTitle") = 0 THEN
  247. SortBy = selectSort.value & selectOrder.value & ",Filename" & selectOrder.value
  248. ELSE
  249. SortBy = selectSort.value & selectOrder.value
  250. END IF
  251. END SUB
  252. '
  253. ' SubRoutine: CmdNext_OnClick()
  254. '
  255. ' Synposis: Displays next page of query results.
  256. '
  257. Private SUB CmdNext_OnClick()
  258. NextPage()
  259. END SUB
  260. '
  261. ' SubRoutine: CmdPrevious_OnClick()
  262. '
  263. ' Synposis: Displays previous page of query results.
  264. '
  265. Private SUB CmdPrevious_OnClick()
  266. RS.Move( -MaxDisplayed - LastOnPage + FirstOnPage )
  267. NextPage()
  268. END SUB
  269. Const L_CreationStatus_Text="Creating query object..."
  270. Const L_IssuingStatus_Text="Issuing query..."
  271. '
  272. ' SubRoutine: CmdGo_OnClick
  273. '
  274. ' Synopsis: Executes query
  275. '
  276. Private SUB CmdGo_OnClick()
  277. ON ERROR RESUME NEXT
  278. '
  279. ' Setup Query
  280. '
  281. Window.Status = L_CreationStatus_Text
  282. SET Q = CreateObject("ixsso.Query")
  283. SET U = CreateObject("ixsso.Util")
  284. Q.LocaleID = U.ISOToLocaleID(navigator.userLanguage)
  285. Q.DefineColumn "Unfiltered(DBTYPE_BOOL, 1) = 49691c90-7e17-101a-a91c-08002b2ecda9 7"
  286. Q.Catalog = "query://"+ machine + "/" + catalog
  287. Q.SortBy = SortBy
  288. Q.Columns = "DocTitle, FileName, Path, Write, Size"
  289. Q.Dialect = 2
  290. '
  291. ' The default use of the query form should be completely freetext.
  292. ' Advanced users can then use all of the features of the query language
  293. ' by having the check boxed checked.
  294. '
  295. IF fUnfiltered THEN
  296. CompSearch = "@Unfiltered=TRUE"
  297. fUnfiltered = FALSE
  298. ELSEIF fFreetext = TRUE THEN
  299. CompSearch = "{freetext}" & UserSearchString.value & "{/freetext}"
  300. ELSE
  301. CompSearch = UserSearchString.value
  302. END IF
  303. '
  304. ' The query is now set up. Time to execute.
  305. '
  306. IF CompSearch <> "" THEN
  307. Q.Query = CompSearch
  308. ' Issue query
  309. Window.Status = L_IssuingStatus_Text
  310. set RS = Q.CreateRecordSet("nonsequential")
  311. Navigation.CmdPrevious.Disabled = TRUE
  312. Navigation.CmdNext.Disabled = TRUE
  313. Navigation2.CmdPrevious.Disabled = TRUE
  314. Navigation2.CmdNext.Disabled = TRUE
  315. HideBottomButt()
  316. IF Err.Number = 0 THEN
  317. NextPage()
  318. ELSE
  319. ReportError Err.Number, Err.Description
  320. Err.Clear()
  321. END IF
  322. END IF
  323. END SUB
  324. '
  325. ' SubRoutine: NextPage
  326. '
  327. ' Synopsis: Workhorse routine to populate table with results
  328. '
  329. Const L_QueryMatched_Text="Query matched "
  330. Const L_Records_Text=" record(s)"
  331. Const L_NoResults_Text="<EM>No results</EM>"
  332. Const L_NoResultsNoEm_Text="No results"
  333. Const L_PopulatingList_Text="Populating result list (row "
  334. Const L_Of_Text=" of "
  335. Const L_NowShowing_Text=" Now showing "
  336. Const L_To_Text=" to "
  337. Const L_Period1_Text="."
  338. Const L_Period2_Text="."
  339. ' working with date format: Change DateSeparator if necessary
  340. ' reposition mm (month), dd (day), yyyy (year) without changing the
  341. ' the individual tokens.
  342. Const L_DateSeparator_Text="/"
  343. Const L_DateFormat_Text = "mm-dd-yyyy"
  344. Private SUB NextPage
  345. '
  346. ' Populate result list. Once this message is displayed, virtually all the time is being
  347. ' spent in DHTML and not in query processing.
  348. '
  349. fFirstPage = TRUE
  350. '
  351. ' Did we actually get anything back?
  352. '
  353. IF RS.RecordCount = 0 THEN
  354. IF Err.Number = 0 THEN
  355. Document.All.Counter.innerHTML = CStr(L_NoResults_Text)
  356. Window.Status = CStr(L_NoResultsNoEm_Text)
  357. MsgBox CStr(L_NoResultsNoEm_Text)
  358. ELSE
  359. ReportError Err.Number, Err.Description
  360. END IF
  361. JumpPoint.scrollintoview ( FALSE )
  362. FirstOnPage = 0
  363. Navigation.CmdNext.Disabled = TRUE
  364. Navigation.CmdPrevious.Disabled = TRUE
  365. Navigation2.CmdPrevious.Disabled = TRUE
  366. Navigation2.CmdNext.Disabled = TRUE
  367. HideBottomButt()
  368. HideTable()
  369. ELSE
  370. JumpPoint.scrollintoview ( TRUE )
  371. FirstOnPage = RS.AbsolutePosition
  372. LastOnPage = FirstOnPage
  373. Document.All.Counter.innerText = CStr(L_QueryMatched_Text) + CStr(RS.RecordCount) + CStr(L_Records_Text)
  374. ShowTable()
  375. END IF
  376. '
  377. ' Loop through the table. For each row, either store values from Recordset or delete
  378. ' the row.
  379. '
  380. FOR i = 1 TO MaxDisplayed
  381. Window.Status = CStr(L_PopulatingList_Text) + CStr(i) + CStr(L_Of_Text) + Cstr(MaxDisplayed) + ")"
  382. IF RS.EOF THEN
  383. '
  384. ' We hit the end. Just clear any remaining rows and fall out of loop.
  385. '
  386. FOR j = Results.Rows.length - 1 TO i STEP -1
  387. Results.DeleteRow(j)
  388. NEXT
  389. EXIT FOR
  390. ELSE
  391. '
  392. ' We may have to add a row...
  393. '
  394. IF i >= Results.Rows.length THEN
  395. Results.InsertRow()
  396. FOR j = 0 TO 4
  397. Results.Rows(i).InsertCell()
  398. NEXT
  399. Results.Rows(i).Cells(0).align = "right"
  400. Results.Rows(i).Cells(2).align = "right"
  401. Results.Rows(i).Cells(3).align = "right"
  402. END IF
  403. ' Write record number
  404. Results.Rows(i).Cells(0).innerText = CStr( RS.AbsolutePosition ) + CStr(L_Period_Text)
  405. ' Write either title or filename
  406. IF VarType(RS("DocTItle")) = 1 Or RS("DocTItle") = "" THEN
  407. Results.Rows(i).Cells(1).innerHTML = "<A HREF=""file://" & RS("path") & """>" & RS("fIlename") & "</A>"
  408. ELSE
  409. Results.Rows(i).Cells(1).innerHTML = "<A HREF=""file://" & RS("path") & """>" & RS("DocTItle") & "</A>"
  410. END IF
  411. ' Size
  412. Results.Rows(i).Cells(2).innerText = RS("SIze")
  413. ' Last Modify time
  414. WriteTime = CDate( RS("WrIte") )
  415. Results.Rows(i).Cells(3).innerText = PrintDate( CStr( L_DateFormat_Text), CStr(L_DateSeparator_Text), CStr(Month(WriteTime)), CStr(Day(WriteTime)), CStr(Year(WriteTime) ) )
  416. ' Path
  417. Results.Rows(i).Cells(4).innerHTML = "<A HREF=""file://" & RS("path") & """>" & RS("Path") & "</A>"
  418. LastOnPage = LastOnPage + 1
  419. RS.MoveNext
  420. END IF
  421. NEXT
  422. '
  423. ' Report result.
  424. '
  425. IF FirstOnPage <> LastOnPage And RS.RecordCount <> 0 THEN
  426. ' "Query matched 392 record(s). Now showing 1 to 25."
  427. Document.All.Counter.innerHTML = CStr(L_QueryMatched_Text) + CStr(RS.RecordCount) + CStr(L_Records_Text) + CStr(L_Period1_Text) + CStr(L_NowShowing_Text) + CStr(FirstOnPage) + CStr(L_To_Text) + CStr(LastOnPage-1) + CStr(L_Period2_Text)
  428. END IF
  429. '
  430. ' Enable Previous/Next as appropriate
  431. '
  432. IF FirstOnPage <= 1 THEN
  433. Navigation.CmdPrevious.Disabled = TRUE
  434. Navigation2.CmdPrevious.Disabled = TRUE
  435. ELSE
  436. Navigation.CmdPrevious.Disabled = FALSE
  437. Navigation2.CmdPrevious.Disabled = FALSE
  438. END IF
  439. IF RS.EOF THEN
  440. Navigation.CmdNext.Disabled = TRUE
  441. Navigation2.CmdNext.Disabled = TRUE
  442. UserSearchString.focus
  443. ELSE
  444. Navigation.CmdNext.Disabled = FALSE
  445. Navigation.CmdNext.focus
  446. Navigation2.CmdNext.Disabled = FALSE
  447. END IF
  448. IF Navigation2.CmdPrevious.Disabled = FALSE OR Navigation2.CmdNext.Disabled = FALSE THEN
  449. ShowBottomButt()
  450. END IF
  451. '
  452. ' Done!
  453. '
  454. Window.Status = Window.DefaultStatus
  455. END SUB
  456. '
  457. ' SubRoutine: HideBottomButt
  458. '
  459. ' Synopsis: Hides the bottom button table from the user's view.
  460. '
  461. SUB HideBottomButt()
  462. BottomButt.Rows(0).Cells(0).style.visibility = "hidden"
  463. BottomButt.Border = 0
  464. BottomButt.Rules = ""
  465. FOR i = BottomButt.Rows.length - 1 TO 1 STEP -1
  466. BottomButt.DeleteRow(i)
  467. NEXT
  468. END SUB
  469. '
  470. ' SubRoutine: ShowBottomButt
  471. '
  472. ' Synopsis: Shows the bottom button table from the user's view.
  473. '
  474. SUB ShowBottomButt()
  475. BottomButt.Rows(0).Cells(0).style.visibility = "visible"
  476. BottomButt.Border = 0
  477. BottomButt.Rules = ""
  478. END SUB
  479. '
  480. ' SubRoutine: HideTable
  481. '
  482. ' Synopsis: Hides the table from the user's view.
  483. '
  484. SUB HideTable()
  485. Results.Rows(0).Cells(0).style.visibility = "hidden"
  486. Results.Rows(0).Cells(1).style.visibility = "hidden"
  487. Results.Rows(0).Cells(2).style.visibility = "hidden"
  488. Results.Rows(0).Cells(3).style.visibility = "hidden"
  489. Results.Rows(0).Cells(4).style.visibility = "hidden"
  490. Results.Border = 0
  491. Results.Rules = ""
  492. FOR i = Results.Rows.length - 1 TO 1 STEP -1
  493. Results.DeleteRow(i)
  494. NEXT
  495. END SUB
  496. '
  497. ' SubRoutine: ShowTable
  498. '
  499. ' Synopsis: Makes the result table visible.
  500. '
  501. SUB ShowTable()
  502. Results.Rows(0).Cells(0).style.visibility = "visible"
  503. Results.Rows(0).Cells(1).style.visibility = "visible"
  504. Results.Rows(0).Cells(2).style.visibility = "visible"
  505. Results.Rows(0).Cells(3).style.visibility = "visible"
  506. Results.Rows(0).Cells(4).style.visibility = "visible"
  507. Results.Border = 1
  508. Results.Rules = "cols"
  509. END SUB
  510. FUNCTION DecodeToken( Token )
  511. 'Replace all escaped characters with their original characters
  512. '%20 --> ' '
  513. 'Characters that must be encoded include any characters that have no
  514. 'corresponding graphic character in the US-ASCII coded character set
  515. '(hexadecimal 80-FF, which are not used in the US-ASCII coded character
  516. 'set, and hexadecimal 00-1F and 7F, which are control characters), blank
  517. 'spaces, "%" (which is used to encode other characters), and unsafe
  518. 'characters (<, >, ", #, {, }, |, \, ^, ~, [, ], and ').
  519. ' This doesn't cover all possible cases, just the SPACE, which is
  520. ' the most common case.
  521. Token = Replace(Token, "%20", " ")
  522. DecodeToken = Token
  523. END FUNCTION
  524. '
  525. ' SubRoutine: ReportError
  526. '
  527. ' Synopsis: Clears table and reports error.
  528. '
  529. ' Arguments: [ErrNo] -- Error to report
  530. '
  531. Const L_RedError_Text="<FONT color=red><EM><B>Error "
  532. SUB ReportError( ErrNo, ErrDesc )
  533. HideTable()
  534. Window.Status = Err.Description
  535. MsgBox Err.Description
  536. UserSearchString.focus
  537. Document.All.Counter.innerHTML = CStr(L_RedError_Text) + Hex(Err.Number) + " - " + Err.Description + "</B></EM></FONT>"
  538. END SUB
  539. </SCRIPT>
  540. <SCRIPT LANGUAGE="JavaScript">
  541. function PrintDate(DateFormat, DateSeparatorText, Month, Day, Year)
  542. {
  543. var FormattedDate
  544. FormattedDate = DateFormat.replace("mm", Month)
  545. FormattedDate = FormattedDate.replace("dd", Day)
  546. FormattedDate = FormattedDate.replace("yyyy", Year)
  547. FormattedDate = FormattedDate.replace("-", DateSeparatorText)
  548. FormattedDate = FormattedDate.replace("-", DateSeparatorText)
  549. return FormattedDate
  550. }
  551. </SCRIPT>
  552. </HTML>