By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,041 Members | 1,046 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,041 IT Pros & Developers. It's quick & easy.

vbscript and SQL Server

P: n/a
Tim
This may not be the right place for this question but here goes. Trying to
execute a sub routine in vbscript that will display the last backup taken of
a SQL Server database. Here is the code I have...

Sub LoadMaintenanceInf

strDBServerName = "."
Set objSQLServer = CreateObject("SQLDMO.SQLServer")
Set objDatabase = CreateObject("SQLDMO.Database")
objSQLServer.LoginSecure = True
objSQLServer.Connect strDBServerName
Set colDatabases = objSQLServer.Databases
For Each objDatabase In colDatabases

set SQL = objSQLServer.executeimmediateandresults "SELECT
MAX(Backup_Finish_Date) FROM MSDB.dbo.BackupSet where Database_Name = ' & '
objDatabase.Name '"

strHTML = strHTML & objDatabase.Name & "<br>"
Next

DataArea.InnerHTML = SQL
end sub

Creating an HTA application that will display the last backup date when a
button is clicked. Any help would be appreciated.
Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.