How do I determine if a COM object is installed?
As long as you know the ProgID (e.g. "Scripting.FileSystemObject"), you can easily determine if a COM object is installed and available for you to use. In the following example, I am going to send an e-mail *if* ASPMail ("SMTPsvg.Mailer") is installed and registered:
If you're not making code decisions based on the results of the check, you can just print out a result. For example, I have a status ASP page I check on all servers we add to our web farm, to make sure that each necessary COM object is installed, registered, licensed where applicable, and works as coded. Here is the type of code I use:
Of course, knowing the object is there is only half the battle sometimes; CDONTS is particularly gnarly to get working properly, and FileSystemObject can be extremely permissions-sensitive.
Related ArticlesCan I code ISAPI filters / extensions with Visual Basic?
DLL: How do I avoid 'Permission Denied' when re-compiling?
How do I detect browsers without components?
How do I determine if a VBScript-based object exists?
How do I generate PDF files from ASP?
How do I generate RTF documents from ASP?
How do I handle MD5 from ASP?
How do I pass server-side values to a client-side ActiveX control?
Should I close my objects and/or set them to nothing?
Should I store objects in session/application scope?
Should I use CreateObject or Server.CreateObject?
When does ASP release COM objects?
Where can I get a shopping cart for my web site?
Where can I get an updated version of browscap.ini?
Why do I get 'Server.CreateObject Access Error'?
Why do I get 8000401A errors?
Why do I get 80040111 errors?
Why do I get 80040112 / 8007045A errors?
Why do I get 800401F3 / 800A01AD errors?
Why do I get 80040460 errors?
Why do I get 80040514 errors?
Why do I get 8007000E errors?
Why do I get 8007007E / 8007007F errors?
Why do I get 80072EE2 errors?
Why do I get 80072EE5 errors?
Why do I get 800A0030 errors?
Why do I get 800A005B errors?
Why do I get 800A9C68 errors?
Why do I get 800C0007 errors?
Why does Browscap give me 'unknown' or tell me IE is Netscape?