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.

107 lines
3.1 KiB

  1. Sub PrintProperties( RS )
  2. Wscript.Echo "PropertyCount=" & RS.Properties.Count
  3. for i = 0 to RS.Properties.Count - 1
  4. Wscript.Echo " Property " & RS.Properties(i).Name & " = " & RS.Properties(i).Value
  5. Next
  6. End Sub
  7. set Q=CreateObject("IXSSO.Query")
  8. Q.Columns = "filename, directory, size, write"
  9. Q.Query = "#filename *.asp"
  10. ' Q.GroupBy = "filename[d]"
  11. Q.GroupBy = "directory[a]"
  12. Q.Catalog = "system"
  13. set Util=CreateObject("IXSSO.Util")
  14. Util.AddScopeToQuery Q, "\"
  15. Q.OptimizeFor = "recall"
  16. Q.AllowEnumeration = TRUE
  17. Q.MaxRecords = 20000
  18. WScript.echo " Query = " & Q.Query
  19. WScript.echo " Columns = " & Q.Columns
  20. WScript.echo " CiScope = " & Q.CiScope
  21. WScript.echo " CiFlags = " & Q.CiFlags
  22. WScript.echo " GroupBy = " & Q.GroupBy
  23. WScript.echo " Catalog = " & Q.Catalog
  24. WScript.echo " OptimizeFor = " & Q.OptimizeFor
  25. WScript.echo " AllowEnumeration = " & CStr(Q.AllowEnumeration)
  26. WScript.echo " MaxRecords = " & Q.MaxRecords
  27. set RS=Q.CreateRecordSet( "nonsequential" )
  28. WScript.echo "RS - IChapteredRowset prop = " & RS.Properties("IChapteredRowset").Value
  29. ' <PRE>
  30. ' WScript.echo " QueryTimedOut =" &if Q.QueryTimedOut then Response.Write("TRUE") else Response.Write("FALSE") %>
  31. ' WScript.echo " QueryIncomplete = " &if Q.QueryIncomplete then Response.Write("TRUE") else Response.Write("FALSE") %>
  32. ' WScript.echo " OutOfDate = " &if Q.OutOfDate then Response.Write("TRUE") else Response.Write("FALSE") %>
  33. CatFieldCount = 0
  34. Header = ""
  35. For i = 0 to RS.Fields.Count - 1
  36. If RS(i).Name <> "Chapter" then
  37. CatFieldCount = CatFieldCount + 1
  38. If header <> "" then
  39. Header = Header & " " & RS(i).Name
  40. else
  41. Header = RS(i).Name
  42. end if
  43. End if
  44. Next
  45. ' PrintProperties( RS )
  46. WScript.Echo Header
  47. F1 = 0
  48. Do While Not RS.EOF
  49. F1 = F1 + 1
  50. Record = Left(CStr(F1) & ". ", 4)
  51. For i = 0 to RS.Fields.Count - 1
  52. If RS(i).Name <> "Chapter" then
  53. ' wscript.echo RS(i).Value
  54. If Record <> "" then
  55. Record = Record & " " & RS(i).Value
  56. else
  57. Record = RS(i).Value
  58. end if
  59. End if
  60. Next
  61. WScript.Echo Record
  62. Set RS2 = RS.Fields("Chapter").Value
  63. ' wscript.echo "typename(rs2) = " & typename(rs2)
  64. F2 = 0
  65. if F1 = 1 then
  66. ' PrintProperties( RS2 )
  67. WScript.echo "RS2 - IChapteredRowset prop = " & RS2.Properties("IChapteredRowset").Value
  68. end if
  69. Do While Not RS2.EOF
  70. F2 = F2 + 1
  71. Record = Left(CStr(F1) + "." + CStr(F2) + ". ", 8)
  72. For j = 0 to RS2.Fields.Count - 1
  73. ' wscript.echo RS2(j).Value
  74. If RS2(j).Name <> "Chapter" then
  75. ' If "FILENAME" <> RS2(j).Name then
  76. If "DIRECTORY" <> RS2(j).Name then
  77. Record = Record & " " & RS2(j).Value
  78. End if
  79. End if
  80. Next
  81. WScript.Echo Record
  82. RS2.MoveNext
  83. Loop
  84. RS2.close
  85. Set RS2 = Nothing
  86. RS.MoveNext
  87. Loop
  88. RS.close
  89. Set RS = Nothing