Classic ASP Server CreateObject - asp-classic

I have zero knowledge of classic ASP and unfortunately I have been given the task of getting a legacy .net webforms/classic asp site up and running. I am almost there (I think) however I am getting an error on this line
set objAppContext = Server.CreateObject( "P21Dat.AppContext" )
Here is the error
Server object error 'ASP 0177 : 8007007e'
Server.CreateObject Failed
/siteconfig.asp, line 71
8007007e
I have no idea what "P21Dat.AppContext" is any help?

99.99% that ActiveX "P21Dat.AppContext" not registered on your machine.
0.01% that you don't have permission ;)
You could try to find in in registry...
You could use OleView program (or "Ole-Com Object Viewer" program) to get information about this ActiveX component...

Even after uninstalling and re-installing it several times, my dll wasn't picked up by my ASP application.
I can clearly see it in Registry list. I even gave permission to that key to everyone but no go.
After several tries I found it was because my dll was on network drive.
I copied to my local machine, un-installed and re-installed from local drive and it started working.

Related

Weird COM issue with classic ASP

I have a COM component that I would like to use from Classic ASP. It is registered correctly using both the 64 and 32 bit version of regasm, using the /codebase switch.
All assemblies are signed with a strong name (although the key is not protected with a password). When I register the types, I get a confirmation that they were registered successfully.
If I make a VBScript file that attempts to create the COM component, it succeeds without issues when I run it with both the 64 and the 32 bit version of cscript.exe.
However, when I try to do a Server.CreateObject on the exact same COM component, I get the following error:
Server object error 'ASP 0177 : 80070002'
Server.CreateObject Failed
somefile.asp, line 2
80070002
The line provided by the excepton just contains the Server.CreateObject statement.
The assembly is AnyCPU, and the type I am trying to expose has a [ComVisible(true)] attribute set on it. The rest of the assembly is not COM visible.
Any clue on what I am experiencing here? I tried giving full permission to Everyone for the DLL files because I originally thought it was an IIS issue. However, that simply doesn't seem to be the case.
I have Googled this for many hours and seen countless similar questions, but this is not related, since none of the proposed solutions work.
If it works correctly with cscript.exe and failed in ASP, almost all the time that is due to the security context or file/register permission issue. ASP runs under the IIS user realm, and you will need to ensure that user ID has access to all the resources (including temp file/folder) needed for your COM object.
I solved it, but as I suspected, it wasn't the same cause as seen in other questions.
Apparently if you try to register a DLL from a network share, it will provide those symptoms, although the message is "Types registered successfully".
Very scary.
When moving all my DLLs to a local folder on the machine, they registered and ran successfully without issues.

Crystal Reports runtime for Visual Studio 2010 not working in Server 2008

Our web application used the old Crystal Reports XI Rel 2 activeX to render the reports called from classic ASP. We would like now to have it run alongside the new Crystal Reports 13 run time to render reports called from ASP.NET.
We installed the exe found in http://scn.sap.com/docs/DOC-7824 (support pack 3). On our dev machines (windows XP) everything went alright, and we were able to design and render reports in both technologies. We tried to deploy it today to a client's server (Windows Server 2008 64 bit) and it obviously didn't work.
If we first try to open the new report then the old one, they both fail, but with completely generic and therefore useless error messages ones like "Error while creating report". the new one is OK, but the old one fails with message "Invalid TLV record".
Inversely, if, after restarting iis, we first try to open an old report (CR XI R2 from classic ASP), it shows correctly, but the new one (CR 13) gives this error:
Retrieving the COM class factory for component with CLSID
{F734A321-8381-4FFD-A614-139E8906DC83} failed due to the following
error: 80000003 One or more arguments are invalid (Exception from
HRESULT: 0x80000003).
We tried to google this error; the only meaningful result was this thread but it didn't help us.
Thank you
EDIT: ok, the first error was simply that the .rpt files were being left out of the deployed folder. So it really boils down to an incompatibility of the CR runtimes, maybe?
EDIT 2: Yes, it is definitely it. We moved the new report in another virtual directory running under another application pool and now they both work, regardless of what is instantiated first. So is there any way we can gradually migrate our existing records, ie have a period where both run times coexist and are used by the same virtual directory?
I had this problem. As I had just installed CR 13 without a reboot, I thought I'd try a reboot of the server. After the reboot, the problem went away.
I have the same error - reboot didn´t help.
Installed SAP Crystal Reports runtime 13.0.0.99 on Win7 but got several errors registering components during installation - think that is the cause of the problem.
Downloaded and installed CR Runtime 13.0.21.2533 (32bit)
from
https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads
http://downloads.businessobjects.com/akdlm/crnetruntime/clickonce/CRRuntime_32bit_13_0_21.msi
That installed without errors but didn´t work either :-(

Object required: 'Server' from Server.MapPath

I am in the process of converting an asp file into vbs and I am hitting a major problem
The line I am getting the error in is simple and is the first line of code
sDBName = Server.MapPath("../mydatabase.accdb")
returns
Microsoft VBScript runtime error: Object required 'Server'
The asp code page works fine when run as normal and I understand the need to remove "Server" from the likes of Server.CreateObject but I know that Server.MapPath should be allowed
I had another problem involving the Provider ACE.OLEDB.12.... but from this forum realised the problem was that I am using a x64 windows 2003 server. The "cscript" fix has not helped in this instance though.
PLEASE PLEASE HELP
Dave
The Server object is part of the ASP scripting environment and isn't generally available for stand-alone VBS scripts.
Also, the MapPath() method is used with respect to a web application's physical location on a server, and doesn't make sense for stand-alone VBS scripts.

AspAllowOutOfProcComponents error: many solutions, one programmer and no fix

I have been trying to work on integrating a NewsLetter for a companies local intranet and I keep running into the same error that everyone seems to be getting. I am running this on IIS 5.1 and on error exists at Server.CreateObject(ADODB.Connection), also the purpose of the ASP code is to read an Excel file
Error Type:
Server object, ASP 0196 (0x80040154)
Only InProc server components should be used. If you want to use LocalServer components, you must set the AspAllowOutOfProcComponents metabase setting. Please consult the help file for important considerations.
I have tried the solution to locate to my AdminScripts directory and setting the boolean value to True with cscript adsutil.vbs set /w3svc/aspallowoutofproccomponents True and then verified by cscript adsutil.vbs enum /w3svc > verified.txt
Opening up the textfile, it does show that the value is set to true but I run into the same error again when trying to access the ASP page. I am at a loss, I figured after reading all those people post questions that I'd ask the question myself.
I cringe at the sight of that error messages, please make my nightmare end.
Its a bizare error to be getting in the first place. Why would the simple ADODB.Connection object be considered an out-of-process component?
The only thing I can think of that might cause this is if someone has accidently dragged the ADO dll into a COM+ Service. Check the set of COM+ Services anything unusual installed there?
In an attempt to repair you could download the latest MDAC from Microsoft's download area and re-install it on your machine.
Enabling out-of-proc components to is not the answer ADODB.Connection should not be out-of-proc.
Next Step
Fire up Regedit, find in Keys the key value of {00000514-0000-0010-8000-00AA006D2EA4} under
HKEY_CLASSES_ROOT
You should find an InprocServer32 key with a default value: C:\Program Files\Common Files\system\ado\msado15.dll
The ProgID should ADODB.Connection.2.8.
I had to use:
Regsvr32.exe "C:\Program Files\Common Files\system\ado\Msado15.dll"
in the command window to have the InProcServer32 key appear, thank you Anthony.
Everything is up and working now. My nightmares are over!

Cannot Start IIS on my PC: COM+ System Application: Access is Denied

I'm trying to do some web development. I cannot start IIS (I need to run some Web Services).
As of about a month ago, the "COM+ System Application" service has started failing with this error:
The COM+ System Application service
failed to start due to the following
error: Access is denied.
DCOM also logs an error in the event log:
DCOM got error "Access is denied. "
attempting to start the service
COMSysApp with arguments "" in order
to run the server:
{ECABAFBC-7F19-11D2-978E-0000F8757E2A}
When I start IIS and the WWW service, everthing seems to work until I hit port 80 on my machine at which time the IIS/WWW services both crash unexpectedly:
The World Wide Web Publishing service
terminated unexpectedly. It has done
this 1 time(s).
The following event is placed in the application log as well:
The run-time environment has detected
an inconsistency in its internal
state. This indicates a potential
instability in the process that could
be caused by the custom components
running in the COM+ application, the
components they make use of, or other
factors. Error in
f:\xpsp3\com\com1x\src\comsvcs\package\cpackage.cpp(1184),
hr = 80070005: InitEventCollector
failed
I have searched google until my fingers are numb. I've searched this site to no avail as well.
I have tried:
running the COM+ System Application service as an administrator.
reinstalling SP3 for XP
giving the "SERVICE" account full control to %SYSTEMROOT%\Registration
removing XP Security hotfixes installed about the time it stopped working
I've removed and reinstalled COM+ (it's possible, check google)
Any insight on the COM+ subsystem, it's files and settings or just how it operates would be greatly appreciated.
I need to get this problem resolved so I can get back to work.
Have you seen this link?
http://support.microsoft.com/kb/909444
I'm having the same problem, and it appears it might have fixed it for me - though I did have to reboot afterwards which isn't explicitly in the kb instructions.
(Though it's hard to tell right now if this actually fixed it, because sometimes for me the problem would disappear on its own after a reboot (which doesn't make a lot of sense given the steps in the kb)).
Sorry all.
I forgot to update this when I found the solution... Well, it was self-inflicted. Some months ago, I removed the execute permissions from dllhost.exe. I hadn't been coding asp.net web apps at the time so I didn't notice the problem and couldn't put two and two together very quickly.
I eventually found it by turning on file system failed auditing on my Windows folder hive. I saw a mess of access denied messages related to dllhost.exe and remembered what I'd done.
Thanks for the help.

Resources