ASV
13 years agoContributor
Restore database
Hi I need to restore database, which I am tesing. I write this- Set sql = CreateObject("SQLDMO.SQLServer") sql.LoginSecure = True sql.Connect cConnectionString Set sq...
I created the following subroutine:
Sub RestoreDatabase()
Sys.OleObject("Wscript.Shell")
osql -S ' + 10.24.0.156 + ' -U ' + sa + ' -P ' + 4rkI0N + ' -Q " RESTORE DATABASE ' + ArkNET_TestComplete + ' FROM DISK = ''' + D:\Database\ArkNET_TestComplete\Backup\ + TestComplete_Backup_5_22_2012 + '.BAK'' WITH REPLACE "' + ' -o "' + c:\temp\ + 'RestoreResult.txt"'
End sub