Question : IIS7 - Server.CreateObject Failed

Dear Experts

We have recently upgraded our web server from Windows 2003 running IIS6 to Windows 2008 and IIS7.

We Office Writer (by SoftArtisans) to create word documents from some of our websites, however we are receiving the error below when attempting to create the word documents.

Can anyone suggest what might be the problem?

Thanks

Grant
1:
2:
3:
4:
5:
6:
7:
Server object error 'ASP 0177 : 800401f3' 

Server.CreateObject Failed 

/easi/cms/wordtemplate.asp, line 84 

800401f3

Answer : IIS7 - Server.CreateObject Failed

One way would be to set the global object. This can cause a timing issue if your global JS variable is not available before this code runs. This is good for an example though.

Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "script", _
        String.Format("setFrmServerCode={0}","SomeValueAsString")

So a second solution might be to create and set the global variable all at once from code behind. It will then be available for all your JS calls from then on.

Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "script", _
        String.Format("var setFrmServerCode={0}","SomeValueAsString")

Another would be to create a function that sets the object and use an event like <body onload> to call the event. This way lets you control the timing and make sure your global variable is available before you try to set it.

Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "script", _
        String.Format("function setGlobal(){{ setFrmServerCode= {0};}}","VariableDataAsString")

I've used all of these methods many times in the past with good success. I didn't convert them to C# as I already had these samples laying around. Hopefully you can see what to do and convert them yourself. If necessary I will convert them for you.
Random Solutions  
 
programming4us programming4us