Leaked source code of windows server 2003
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.

124 lines
5.6 KiB

  1. Dim cn
  2. Dim rs
  3. Dim rsTen
  4. Dim objMail
  5. Dim strProfileInfo
  6. Dim strServer
  7. Dim strMailBox
  8. Dim objSession
  9. Dim strBody
  10. Dim strBucketNumber
  11. Set cn = CreateObject("ADODB.Connection")
  12. Set rs = CreateObject("ADODB.Recordset")
  13. Set rsTen = CreateObject("ADODB.Recordset")
  14. 'on error resume next
  15. Set oMail = CreateObject("CDO.Message")
  16. With cn
  17. .ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;Pwd=ocarpts@2;User ID=ocarpts;Initial Catalog=CrashDB2;Data Source=tkwucdsqla02"
  18. .CursorLocation = 3
  19. .Open
  20. End With
  21. Set rs = cn.Execute("EmailCounts")
  22. rs.MoveFirst
  23. Do While rs.EOF = False
  24. 'For x = 0 To 10
  25. If rs.Fields(0).Value > 0 Then
  26. Set rsTen = cn.Execute("EmailTopTen '" & rs.Fields(1) & "'")
  27. oMail.From = "[email protected]"
  28. '' oMail.To = "[email protected]"
  29. 'oMail.To = "andreva"
  30. oMail.To = rs.Fields(1).Value & "@microsoft.com"
  31. 'oMail.To = "[email protected]"
  32. 'oMail.CC = "andreava"
  33. oMail.Subject = "Daily Bucket Count"
  34. strBody = "<html><body><h3><font color=red>"
  35. strBody = strBody & "Daily Bucket Count for " & rs.Fields(1).Value & " alias"
  36. strBody = strBody & "</font></h3>"
  37. strBody = strBody & "<b><font color=red>There are currently "
  38. strBody = strBody & rs.Fields(0).Value & " buckets assigned to this alias in the OCA Analysis DB.</font></b>"
  39. strBody = strBody & "<p>Click here to view the buckets "
  40. strBody = strBody & "<a target='_blank' href='http://winweb/bluescreen/debug/v2/DBGPortal_DisplayQuery.asp?SP=DBGP_GetBucketsByAlias&Param1=All&Param2=All&Param3=CrashCount&Param4=DESC&Param5=" & rs.Fields(1).Value & "'>" & rs.Fields(1).Value & "</a>"
  41. strBody = strBody & "<BR><BR>"
  42. If rsTen.State = 1 Then
  43. strBody = strBody & "<p>Top 10 List of Buckets<br><br>"
  44. strBody = strBody & "<table width=100% border=1 cellpadding=3 cellspacing=3><tr bgcolor=#99cccc>"
  45. strBody = strBody & "<td align=Center style=color:#660033;font-weight:Bold>Bucket#</td>"
  46. strBody = strBody & "<td align=Center style=color:#660033;font-weight:Bold>BucketID</td>"
  47. strBody = strBody & "<td align=Center style=color:#660033;font-weight:Bold>Followup</td>"
  48. strBody = strBody & "<td align=Center style=color:#660033;font-weight:Bold>Count</td>"
  49. strBody = strBody & "<td align=Center style=color:#660033;font-weight:Bold>BugID</td>"
  50. strBody = strBody & "<td align=Center style=color:#660033;font-weight:Bold>SolutionID</td><tr>"
  51. strBody = strBody & "<tr bgcolor=#ff6633><td colspan=8><b>Buckets</b></td></tr><tr>"
  52. Do While rsTen.EOF = False
  53. If IsNull(rsTen.Fields(0).Value) Then
  54. strBody = strBody & " &nbsp; "
  55. Else
  56. strBucketNumber = rsTen.Fields(0).Value
  57. End If
  58. If Len(strBucketNumber) > 5 Then
  59. strBody = strBody & "<tr><td>"
  60. strBody = strBody & strBucketNumber & "</td>"
  61. Else
  62. strBody = strBody & "<td>"
  63. strBody = strBody & strBucketNumber & "</td>"
  64. End If
  65. If Len(rsTen.Fields(1).Value) > 15 Then
  66. strBody = strBody & "<td>"
  67. ' strBody = strBody & "<a target='_blank' href='http://winweb/bluescreen/debug/v2/DBGPortal_ViewBucket.asp?BucketID=" & rsTen.Fields(1).Value & ">"
  68. strBody = strBody & Left(rsTen.Fields(1).Value, 40) & "</td>"
  69. ' ElseIf Len(rsTen.Fields(1).Value) > 10 Then
  70. ' strBody = strBody & "<td>" & rsTen.Fields(1).Value & "</td>"
  71. ' ElseIf Len(rsTen.Fields(1).Value) > 5 Then
  72. ' strBody = strBody & "<td>" & rsTen.Fields(1).Value & "</td>"
  73. Else
  74. strBody = strBody & "<td>" & rsTen.Fields(1).Value & "</td>"
  75. End If
  76. If Len(rsTen.Fields(2).Value) > 5 Then
  77. strBody = strBody & "<TD>" & Left(rsTen.Fields(2).Value, 25) & "</td>"
  78. Else
  79. strBody = strBody & "<TD>" & rsTen.Fields(2).Value & "</td>"
  80. End If
  81. If Len(rsTen.Fields(3).Value) > 5 Then
  82. strBody = strBody & "<TD>" & rsTen.Fields(3).Value & "</TD>"
  83. Else
  84. strBody = strBody & "<TD>" & rsTen.Fields(3).Value & "</TD>"
  85. End If
  86. If IsNull(rsTen.Fields(4).Value) Then
  87. strBody = strBody & "<td>" & " &nbsp; " & "</TD>"
  88. Else
  89. strBody = strBody & "<TD>"
  90. strBody = strBody & "<a target='_blank' href='http://liveraid/?ID=" & rsTen.Fields(4).Value & "'>"
  91. strBody = strBody & rsTen.Fields(4).Value & "</a></TD>"
  92. End If
  93. If IsNull(rsTen.Fields(5).Value) Then
  94. strBody = strBody & "<TD>" & " &nbsp; " & "</TD>"
  95. Else
  96. strBody = strBody & "<TD>" & rsTen.Fields(5).Value & "</TD>"
  97. End If
  98. strBody = strBody & "</TR>"
  99. rsTen.MoveNext
  100. Loop
  101. End If
  102. strBody = strBody & "</table></body></html>"
  103. oMail.HTMLBody = strBody
  104. oMail.Send
  105. End If
  106. rs.MoveNext
  107. ' Next
  108. Loop
  109. If rs.State = 1 Then
  110. rs.Close
  111. End If
  112. If cn.State = 1 Then
  113. cn.Close
  114. End If
  115. Set oMail = Nothing
  116. Set rs = Nothing
  117. Set cn = Nothing