<%
Dim srv
Dim objDB
Set srv = Server.CreateObject("SQLDMO.SQLServer")
srv.LoginTimeout = 15
srv.Connect "servername", "username", "password"
Set objDB = Server.CreateObject("SQLDMO.Database")
%>
<SELECT name="fdatabase">
<%
For Each objDB In srv.Databases
If objDB.SystemObject = False Then
%>
<OPTION><%=objDB.Name%></OPTION>
<%
End If
Next
%>
</SELECT>
<%
Dim srv
Dim objDevice
Set srv = Server.CreateObject("SQLDMO.SQLServer")
srv.LoginTimeout = 15
srv.Connect "servername", "username", "password"
Set objDevice = Server.CreateObject("SQLDMO.BackupDevice")
For Each objDevice In srv.BackupDevices
Response.Write objDevice.Name + "<BR>"
Next
%>
<%@ Language=VBScript %>
<HTML>
<BODY>
<!--Login information -->
<!--#include file=login.asp-->
<P>
<%
Dim objDevice
Dim objResults
Dim iCount
Dim xCount
'创建备份装置对象
Set objDevice = Server.CreateObject("SQLDMO.BackupDevice")
'循环直到找到匹配的装置
For Each objDevice In srv.BackupDevices
If objDevice.Name = Request("fname") Then
'找到匹配装置,开始读取结果
Set objResults = objDevice.ReadBackupHeader
For iCount = 1 To objResults.Rows
For xCount = 1 To objResults.Columns%>
<B><%=objResults.ColumnName(xcount)%></B>:
<%=objResults.GetColumnString(icount,xcount)%><br>
<%Next %>
<HR>
<%Next %>
<%End If%>
<%Next%>
<%
srv.Disconnect
set srv = nothing
set objDevice = nothing
set objResults = nothing
%>
</BODY>
</HTML>