If you execute a vb script which use SQL-DMO on SQL Server 2008, you will notice that the script doesn’t work at all.
You will see the error message as similar to this one when you execute the vb script:
Error: ActiveX component can't create object: 'SQLDMO.SQLServer' Code: 800A01AD Source: Microsoft VBScript runtime error |
Cause
This is because SQLDMO is deprecated since SQL Server 2005. But SQLDMO is installed on SQL Server 2005 by default so you can run a vb script which uses SQLDMO without any error on SQL Server 2005. On SQL Server 2008, SQLDMO is not installed by default . If you want to use SQLDMO, you have to install it manually.
Solution
To use SQL-DMO on SQL Server 2008, you need to download and install Microsoft SQL Server 2005 Backward Compatibility Components to solve the problem. You can go to Microsoft Download Center and search for “Microsoft SQL Server 2008 Feature Pack” and sort by Release Date to find the latest version.
Step-by-step
- Download Microsoft SQL Server 2005 Backward Compatibility Components from Microsoft or at SQLServer2005_BC (32-bit, x86). Next, execute the setup file.
- On Welcome to the Install Wizard for Microsoft SQL Server 2005 Backward compatibility Setup, click Next.
- On License Agreement, select ‘I accept the terms in the license agreement‘. Then, click Next.
- On Registration Information, enter your personal information. Then, click Next.
- On Feature Selection, ensure that SQL Distributed Management Objects is selected. Then, click Next.
Note: SQL-DMO is the feature that is require to run a vb script that uses DMO.
- On Ready to Install the Program, click Install.
- Installing Microsoft SQL Server 2005 Backward compatibility.
- On Completing the Microsoft SQL Server 2005 Backward compatibility Setup, click Finish. Now try to run vb script again, the problem should be gone!
thanks!
Did not work!
Thanks, this fixed my specific issue related to the nebulous error message “ActiveX component can’t create object”. It was related to the legacy DTS tools not included in SQL 2008.
Thanks!!
Thanks. Saved a lot of time.
Excellant! thank you…
64 bit server/sql so had to search for 64bit version which i found here “Microsoft SQL Server 2008 Feature Pack, October 2008”
Link to x64 was http://go.microsoft.com/fwlink/?LinkId=123703&clcid=0x409
Outstanding post, really appreciate it!
There is also 2008 Feature pack now:
“Microsoft SQL Server 2008 Feature Pack, April 2009”
http://www.microsoft.com/download/en/details.aspx?id=3522
Hello Linglom,
I’m creating a vbscript for SQL Server migrating (backup from source server / Restore on new server / Verify Db are ok / Detach from old server).
I found your script “automate-backup-database-on-sql-server-part-i-create-vb-script” that uses SQLDMO and then i found this article here…
In VBScript, do we have an alternate solution to SQLDMO without need to install the “backward compatibility” patch ? Can you update your script to use this solution ?
Regards,
Letoine