Search code examples
asp-classiccom+

Error 'ASP 0177 : 800401f3'


I am first time working with ASP components.. I created 2 files.. 1 txt which has following code:

REDIRECT redir.asp
width 420
height 50
border 0
*
homeloan.gif
http://www.paisavasoolbank.com
All Kinds of Home Loans
70
hawai.gif
http://www.hotelhawai.com
Visit Hotel Hawai
30

and the second ASP file with following code:

<html>
<head>
</head>
<body>
<%
Set myad= Server.CreateObject("MSWC.AdRotator")
Response.Write(myad.GetAdvertisement("adrotator.txt"))
%>
</body>
</html>

Execution of ASP file resulted in following error:

Server object error 'ASP 0177 : 800401f3'

Server.CreateObject Failed

/MyWeb/choicenext.asp, line 7

800401f3

I have no idea what is this as am new to this concept.


Solution

  • MSWC.AdRotator I assume is a DLL. You have to register this as a COM object before you can use it. There are different ways to register these depending on whether you are using 32 or 64 bit and your version of IIS but generally your options can be broken down to:

    C or C++ or other binaries use regsvr32

    1. c:\windows\system32\regsvr32.exe for 32-bit dlls on a 32 bit machine and 64 bit dlls on a 64 bit machine
    2. c:\windows\syswow64\regsvr32.exe for 32-bit dlls on a 64 bit machine

    For .NET framework DLLs you have to register them using Regasm found in the framework folder

    1. c:\program files\microsoft\framework\2......\regasm.exe for dlls in .net 2
    2. c:\program files\microsoft\framework\4......\regasm.exe for dlls in .net 4

    To be honest, whenever I was in doubt when I worked with these, I just tried all four of the above until one of them worked, this is admittedly not the best practice.

    Here is another issue that better explains when to use regsvr32 vs regasm. What is difference between RegAsm.exe and regsvr32? How to generate a tlb file using regsvr32?