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...
Vahagn,
Also for me is very interesting why I have that two errors. If anybody knows please help me
I think, you got the "Microsoft VBScript runtime error ActiveX component can't create object" error, because some appropriate components (SQL Database Management Objects) are not installed on your computer, or they are not registered properly in the system. I think, you can try downloading SQLDMO modules from the Microsoft web site and install them on your computer. Follow the links below:
http://technet.microsoft.com/en-us/library/ms141187(v=SQL.100).aspx
http://social.msdn.microsoft.com/Forums/en-US/sqlsmoanddmo/thread/5cfb1ef2-9da3-492f-ace6-4eafdb73b34a
Microsoft says that these objects are obsolete (http://msdn.microsoft.com/en-us/library/ms131540(v=SQL.105).aspx), so you may need to consider using some other approaches to restore your database. Kate's approach seems to be a reasonable solution.
As for the second error, I think, performing this operation via COM ADO objects just takes more time than doing it in SQL Management Studio. You could try increasing the timeout, say, to 600 seconds, and check if this works.
BTW, to restore databases and set up the test environment, you can try using Automated Build Studio. It provides an easy-to-use visual way to perform these and many other operations. As far as I know, it takes an active part in our QA tasks at SmartBear. A free trial is available here: http://smartbear.com/products/software-development/software-release-management/free-automated-build-studio-trial.
Anyway, I'm glad to hear that Kate's solution works fine for you :-)