If you are unfortunate enough to be working with VB6, VBScript, Classic ASP and COM components on a 64-bit machine you need to make sure your calling code is running the same process type as the COM component.
When you register a 32-bit COM component on a 64-bit machine it adds all the relevant bits to the HKEY_CLASSES_ROOT\Wow6432Node\CLSID node in the registry.
Here I have registered a 32-bit COM component and searched for it’s class id:
If the consuming client is running in a 64-bit process, when it tries to create the object it will fail because it will look in the default 64-bit area of the registry.
For my tests I have a COM component registered called HTestLibrary.
I have the following VBScript to create the object:
Set y = CreateObject("HTestLibrary3.MyClass3")
Running the VBScript directly on 64-bit machine caused the following error:
By default the the script runner (cscript or wscript) is run under a 64-bit process so the COM registry lookup fails. To run the script under 32-bit process you need run the 32-bit version of cscript or wscript, this can be done by using the 32-bit version of CMD:
The error you get when using Classic ASP in 64-bit mode is ‘Automation server can't create object’. To fix this you need to set the application pool for the website to run under 32-bit process so in the advanced settings for the application pool set the ‘Enable 32-Bit applications’ setting to true:
MSDN - COM Component Compatibility
SO - How do I run a VBScript in 32-bit mode on a 64-bit machine?