In classic ASP, I am trying to create an ActiveX object. Basically, I am trying to create a Crystsal Reports Runtime object.
Dim oCR = CreateObject("CrystalDesignRunTime.Application")
I am getting "ActiveX cannot create object" error.
This works fine on another developer machine. And both developer machines have Windows 7 VB 6 EE with SP 6 and Crystal Reports Developer edition 13.0.
Help needed :-(
If this is classic ASP, with VBScript, then:
Dim oCR = CreateObject("CrystalDesignRunTime.Application")
... is definitely not going to work. This should be:
Dim oCR
Set oCR = CreateObject("CrystalDesignRunTime.Application")
As for the "ActiveX cannot create object" error, this is due to an installation failure of the Crystal Reports component. I would recommend you first try reinstalling the component. Failing that, look in the installation folder, and work out which file implements the ActiveX component (crtslv.dll ?). Then go to a command line and type:
regsvr32.exe "<component DLL file>"
Related
UPDATE
Now, after trying to use EWS as an alternative I've been getting this new error message that I can't seem to fix :
DTD is prohibited in this XML document.
And yes I've given these code a try :
Dim settings As XmlReaderSettings = New XmlReaderSettings()
settings.XmlResolver = Nothing
settings.DtdProcessing = DtdProcessing.Parse
settings.ValidationType = ValidationType.DTD
Dim reader As XmlReader = XmlReader.Create(".xml", settings)
But it made no difference. Please Help!!
For your information : I'm trying to make this to run in a web based version
My code works perfectly during execution to read email using VB.NET.
Unfortunately this happen :
"Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"
Additional Info:
I'm a company worker = email I want to retrieve is using company
domain (eg: ...#company.com)
Windows 10
Microsoft Outlook 2016
Visual Studio 2012
.NET framework 4.5.1 & 4.5.2
I code it using Microsoft.Office.Interop
I've searched google for solution on how to handle the problem and so far no luck.
I've tried modifying DCOM
I want to download new security update from support.microsoft, but no luck with the company internet restriction
Please help. I've been stuck for almost a month on this problem
Most likely this happens if Outlook and your app are running in different security contexts (e.g. one app is running as an admin). Try to close Outlook before starting your app - if that works, you have mismatched security context.
Also keep in mind that Office apps (including Outlook) cannot run in a service (such as IIS).
I've followed this: http://www.codeproject.com/Articles/19535/NET-COM-Interop-Component-with-Classic-ASP-Part-I & http://bruceburge.com/2009/06/11/sharing-net-libary-dlls-between-asp-classic-and-aspnet/ to use asp.net dll in classic asp.
Step 7 listed in first URL didn't work me hence I followed steps given in second URL to to create installation. It works & can see URL in GAC. Unfortunately, it is not working in classic asp.
I tried "regsvcs" at command prompt but didn't work. have developed using C#
Anybody knows what I'm missing?
Update: I could see component under Component Services. I don't see method name under Interfaces & creating object of component is not working. am getting this error:
Expected end of statement on line:
set obj= server.CreateObject("my_dll_New.Class1");
I have a Web Site with an Service.svc file, i created this using the Add New Item -> AJAX-enabled WCF Service, for weeks, everything works fine.
Today, i imported the EPplus.dll to generate some excel files. When i try to compile i get this error
Error 1 Reference.svcmap:
Failed to generate code for the service reference 'QUAY.Tractebel.COP.Servicos'.
Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension:
System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: Type 'OfficeOpenXml.ExcelRangeBase' is a recursive collection data contract which is not supported.
Consider modifying the definition of collection 'OfficeOpenXml.ExcelRangeBase' to remove references to itself.
XPath to Error Source: //wsdl:definitions[#targetNamespace='']/wsdl:portType[#name='Servicos'] App_WebReferences/QUAY/Tractebel/COP/Servicos/
I have no idea how to solve it, someone can help me?
Just had the same problem while referencing a custom wcf class i use.
The strange problem is that on my old development pc (windows vista 32bit, visual studio 2010) i haven't got this problem, it only pops up in my new system (windows 8 64bit).
Bah.
However, i bypassed the problem opening App_WebReferences --> "your service name" --> Right click on depending Refrence icon --> "Configure service reference"
In this screen move the option button from "Reuse types in all referenced assembiles" to "Reuse types in specified assemblies" and check all the depending libraries EXCEPT EPPlus
Compile and ... voila
If someon has also a logic explanation, i'll gladly listen
I am debugging this Active X dll using the VB6 IDE. I can see the execution get as far as an attempt to GetObjectContext. This method always returns NOTHING.
This is happening on Windows 7 32 bit, IIS 7. (The application is working in other locations, one of which is Windows Server 2008 with IIS 7)
I have Googled extensively and found many references to this relating to COM+, but there is NO COM+ involved in my scenario. Just plain old Server.CreateObject from a registered dll.
I have ASP code as follows
SET objCalendar = Server.CreateObject("SSYSDEV.Calendar")
objCalendar.BuildCalendar("ADMINUSERS")
SET objCalendar = Nothing
The problem lines of the requested function in the dll are:
Dim objHttpRequest As ASPTypeLibrary.Request
Set objHttpRequest = GetObjectContext.Item("Request")
Any help or suggestions, as always, will be greatly appreciated.
I'm still getting over the shock of having to work with VB6 - I never thought it would happen! It's like being dragged back to the dark ages, in a very rough fashion that's causing blisters!
P.S. I have also set up a COM+ component and had the ASP get the object that way, GetObjectContext returns an empty object in this case, which has no ASP objects in it. So this is no help :-(
I know this is a little late, but I had a similar problem and this solved it for me:
Thread: Problem accessing Request object via COM+
http://forums.iis.net/t/1146404.aspx
Summary: turn on 'Allow IIS Intrinsic Properties' in the COM+ component.
I've found that the COM+ approach to using VB6 components in IIS to be a bit flaky. I add this to a VB6 class that I want to instance in ASP::-
Private moScriptCtx As ScriptingContext
Public Sub OnStartPage(SC As ScriptingContext)
Set moScriptCtx = SC
End Sub
You can now access Request,Response,Server etc as properties of the moScriptCtx object.
You might be wondering how you call OnStartPage in the first place. You don't ASP automagically does that for you during the CreateObject execution.
I am writing a navigation system in classic ASP (on Windows CE).
I require a way to dynamically include navigation files based on the calling script.
I have come up with the following code that includes nav.inc that is located in the folder of the calling script to allow different folders to have different navigational features.
This works fine on my Windows test machine but NOT when I deploy to Windows CE. The code and error is shown below. If anyone can provide a work around or any feedback that would be great. Thanks
Code:
<%
'Get path name
Dim i
fullname = Request.ServerVariables("SCRIPT_NAME")
my_array=split(fullname,"/")
fname=my_array(ubound(my_array))
fname = ""
For i = 0 to ubound(my_array) - 1
fname = fname & my_array(i) & "/"
Next
fname = fname & "nav.inc"
Set fs=Server.CreateObject("Scripting.FileSystemObject")
If (fs.FileExists(Server.MapPath(fname)))=true Then
Server.Execute(fname)
End If
%>
Error:
Microsoft VBScript runtime error:
'800a01b6'
Description: Object doesn't support
this property or method:
'Server.CreateObject'
If I alter the code to just say Set fs=CreateObject("Scripting.FileSystemObject") I get the following error:
Microsoft VBScript runtime error:
'800a01ad'
Description: ActiveX component can't
create object:
'Scripting.FileSystemObject'
Update I have just tried running Server.Execute directly and this fails too. It looks like I do not have any access to the Server object. Is there any work around for this as well?
CreateObject and Execute are not supported in Windows CE.
The <OBJECT> tag is not supported also, so, you are out of luck, sorry.
Server Object Implementation
---------------------------
The Server object provides access to methods and properties on the server.
Most of these methods and properties serve as utility functions.
Server method Windows CE implementation
-----------------------------------------
CreateObject Not supported
Execute Not supported
GetLastError Not supported
HTMLEncode Not supported
MapPath Fully supported
ScriptTimeout Not supported
Transfer Not supported
URLEncode Fully supported
Source