1. Class clsServerBackupInfoList
2.
3.  	private strSQLServer
4.  	private strDataBase
5.  	private objCon
6.  	private SQL2
7.  	private RS1
8.  	private str
9.  	private fd
10. 	private ConnectionString
11. 	private boolEOF
12. 	
13. 	Private Sub Class_Initialize()
14. 		boolEOF = true
15. 	End Sub
16. 	
17. 	Private Sub Class_Terminate()
18. 		if RS1.State <> 0 then
19. 			RS1.close
20. 			Set RS1 = Nothing
21. 		end if
22. 		Call closeConnection
23. 	End Sub
24. 	
25. 	Public Property Let SQLServer ( byVal tmpSQLServer )
26. 	  strSQLServer = tmpSQLServer
27. 	  if len(strSQLServer) > 0 then 
28. 	    Set objCon = WScript.CreateObject("ADODB.Connection") 		
29. 			
30. 	    ConnectionString   =   "Provider=sqloledb;"
31. 	    ConnectionString   =   ConnectionString	&   "Data Source=" & strSQLServer & ";" 
32. 	    ConnectionString   =   ConnectionString	&   "Initial Catalog=MSDB;"
33. 	    ConnectionString   =   ConnectionString	&   "Integrated Security=SSPI;"
34. 			
35. 	    objCon.Open ConnectionString
36. 	    SQL2 = SQL2 & "SELECT distinct database_name FROM sysdbmaintplan_history " 
37. 	    SQL2 = SQL2 & "WHERE (activity LIKE " & "'" & "backup database" & "'" & ")"
38.			
39. 	    Set RS1 = objCon.Execute(SQL2)
40.
41. 	    if not RS1.eof then
42. 	       strDatabase = RS1("database_name")
43. 	       boolEOF = False
44. 	    else 
45. 	       boolEOF = True
46. 	    end if
47. 	  end if
48. 	End Property
49.	
50. 	Public Property Let Database ( byVal tmpDatabase )
51. 		strDatabase = tmpDatabase
52. 	End Property
53.	
54. 	Public Property Get SQLServer
55.	    	SQLServer = strSQLServer
56. 	End Property
57.
58. 	Public Property Get Database
59.	    	Database = strDatabase
60.     End Property
61.
62. 	Public Property Get EOF
63. 		EOF = boolEOF
64. 	End Property
65.
66.  	Public Sub MoveNext
67. 			RS1.MoveNext
68. 		if not RS1.EOF then
69. 			strDatabase = RS1("Database_name")
70. 			boolEOF = false
71. 		else 
72. 			boolEOF = True
73. 		end if
74. 	end sub
75. 
76.	 Private Sub closeConnection()	
77.	 	objCon.Close
78.	 End Sub
79. 
80. End Class