/beta/admin/kid_dbtest.asp

http://github.com/khaneh/Orders · ASP · 73 lines · 63 code · 5 blank · 5 comment · 3 complexity · 03e80e5359a769562e50fa1e8f8b8a2b MD5 · raw file

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%>
  2. <HTML>
  3. <HEAD>
  4. <meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
  5. <meta http-equiv="Content-Language" content="fa">
  6. <style>
  7. Table { font-family:tahoma; font-size: 9pt;}
  8. </style>
  9. <TITLE>Test</TITLE>
  10. </HEAD>
  11. <BODY>
  12. <%
  13. ' Open connection
  14. ' strCnxn = "DRIVER={SQL Server};SERVER=(local);DATABASE=sefareshat;UID=sefadmin; PWD=5tgb;"
  15. strCnxn = "Provider=SQLNCLI10.1;Persist Security Info=False;User ID=sefadmin;Initial Catalog=sefareshat;Data Source=(local);PWD=5tgb;"
  16. Set Cnxn = Server.CreateObject("ADODB.Connection")
  17. Cnxn.Open strCnxn
  18. ' Open compound recordset
  19. Set rstCompound = Server.CreateObject("ADODB.Recordset")
  20. SQLCompound = "exec proc_Test"
  21. rstCompound.Open SQLCompound, Cnxn, 3 'adOpenStatic
  22. ' Display results from each SELECT statement
  23. errCount = 0
  24. catCount = 0
  25. allCats = 0
  26. errCatName =""
  27. errCatCount=0
  28. Dim errCatNames (50)
  29. Dim errCatCounts (50)
  30. startTime = timer
  31. Do Until rstCompound Is Nothing
  32. if rstCompound.EOF then
  33. response.write " :: <FONT COLOR='green'>OK</FONT><br>"
  34. else
  35. if isnumeric(rstCompound.Fields(0)) then
  36. response.write "<FONT COLOR='red'>"
  37. catCount = catCount + 1
  38. errCatNames(catCount) = errCatName
  39. errCatCount=0
  40. Do Until rstCompound.EOF
  41. errCount = errCount + 1
  42. errCatCount = errCatCount + 1
  43. response.write "<br>" & rstCompound.Fields(0)
  44. rstCompound.MoveNext
  45. Loop
  46. errCatCounts(catCount) = errCatCount
  47. response.write "<br></FONT>"
  48. else
  49. allCats = allCats + 1
  50. errCatName = rstCompound.Fields(0)
  51. response.write "<br>" & errCatName
  52. end if
  53. end if
  54. Set rstCompound = rstCompound.NextRecordset
  55. Loop
  56. ' clean up
  57. Cnxn.Close
  58. Set rstCompound = Nothing
  59. Set Cnxn = Nothing
  60. response.write "<br><hr><hr>"
  61. for i = 1 to catCount
  62. response.write errCatNames(i) & ": " & chr(9) & errCatCounts(i) & "<br>"
  63. Next
  64. endTime = timer
  65. response.write "<hr><hr>End <br>"& errCount & " Errors Found in "& catCount & " Categories (Out of "& allCats & " Cat.s)<br>Operation took " & endTime - startTime & " secconds."
  66. %>
  67. </BODY>
  68. </HTML>