0

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.

user692942
  • 16,398
  • 7
  • 76
  • 175
YusufSM
  • 45
  • 1
  • 5
  • 2
    This might help http://ediblecode.com/blog/dev/asp-800401f3-error, unfortunately your question is too broad. You have not provided any details of your environment *(Windows Server version etc., or whether your even using server)* is your architecture 32 or 64 bit?, what version of IIS your using *(5, 6, 7 or above)* the list goes on. Basically though this error means the server either doesn't have permission to create the `MSWC.AdRotator` component or it can't find it *(likely because it isn't registered with COM or registered in the wrong place)*. – user692942 Jul 13 '15 at 11:09
  • 3
    Possible duplicate of http://stackoverflow.com/q/19392038/692942 – user692942 Jul 13 '15 at 11:15
  • I am using Windows 7 Home Premium 64 bit and IIS7 is installed. This is not a Server and Comp is not on any Network. Some one told me that AdRotator is not supported by IIS7 anymore. I dont have any idea. What is an alternative? – YusufSM Jul 14 '15 at 16:17
  • Did you look at that first link I posted? – user692942 Jul 14 '15 at 16:21

1 Answers1

0

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?

Community
  • 1
  • 1
sanpaco
  • 785
  • 1
  • 14
  • 32
  • Great advice *"just try them all one will work"* *(paraphrased)*. If you don't understand the differences you shouldn't try answering the question. Not to mention you haven't mentioned something that isn't already mentioned on the numerous `Server.CreateObject failed` questions floating around and in the comments on this very question. Also the correct file is `regsvr32.exe` for COM library registration. – user692942 Jul 14 '15 at 12:51
  • Point 1. is partially correct - `c:\windows\system32\regsvr32` is for registering 32 bit and 64 bit DLLs on 32 and 64 bit machines respectively. Point 2. Is correct if you replace `regsvr.exe` with `regsvr32.exe`. – user692942 Jul 14 '15 at 12:57
  • 1
    Just trying to help, thanks for pointing out where I was mistaken. – sanpaco Jul 14 '15 at 15:40
  • Glad it worked for you. I just made a few edits to try and add a little more clarity on the different ways to register DLLs – sanpaco Jul 15 '15 at 16:17