PageRenderTime 21ms CodeModel.GetById 13ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/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;"
15strCnxn = "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    
19    ' Open compound recordset
20    Set rstCompound = Server.CreateObject("ADODB.Recordset")
21    SQLCompound = "exec proc_Test"
22    rstCompound.Open SQLCompound, Cnxn, 3 'adOpenStatic
23    
24    ' Display results from each SELECT statement
25    errCount = 0
26    catCount = 0
27	allCats	= 0
28	errCatName =""
29	errCatCount=0
30	Dim errCatNames (50)
31	Dim errCatCounts (50)
32	startTime = timer
33    Do Until rstCompound Is Nothing
34        if rstCompound.EOF then
35			response.write " :: <FONT COLOR='green'>OK</FONT><br>"
36        else
37			if isnumeric(rstCompound.Fields(0)) then
38				response.write "<FONT COLOR='red'>"
39				catCount = catCount + 1
40				errCatNames(catCount) = errCatName
41				errCatCount=0
42				Do Until rstCompound.EOF
43					errCount = errCount + 1
44					errCatCount = errCatCount + 1
45					response.write "<br>" & rstCompound.Fields(0) 
46					rstCompound.MoveNext
47				Loop
48				errCatCounts(catCount) = errCatCount
49				response.write "<br></FONT>"
50			else
51				allCats = allCats + 1
52				errCatName =	rstCompound.Fields(0)
53				response.write "<br>" & errCatName 
54			end if
55        end if
56        Set rstCompound = rstCompound.NextRecordset
57    Loop
58   
59    ' clean up
60    Cnxn.Close
61    Set rstCompound = Nothing
62    Set Cnxn = Nothing
63
64	response.write "<br><hr><hr>"
65	for i = 1 to catCount
66		response.write errCatNames(i) & ": " & chr(9) & errCatCounts(i) & "<br>"
67	Next 
68
69	endTime = timer
70	response.write "<hr><hr>End <br>"& errCount & " Errors Found in "& catCount & " Categories (Out of "& allCats & " Cat.s)<br>Operation took " & endTime - startTime & " secconds."
71%>
72</BODY>
73</HTML>