Excel VBA DBEngine.CreateWorkspace fails saying cannot load DLL - excel

I have a legacy business application written in VBA in Excel. It uses the VBA DAO library (installed at c:\program files (x86)\Common Files\Microsoft Shared\DAO\dao360.dll) and the classes Workspace, Database, DBEngine, Connection) to connect to a SQL database via ODBC.
It works properly up to Windows 7, but on Windows 8 /Server 2012, it doesn't work, on the very first call to DAO:
Set ws = DBEngine.CreateWorkspace(wsName, "", "", dbUseODBC)
raises a runtime error number 3633 description "Cannot load DLL: 'msrdo20.dll'". This occurs both in the class library's DBEngine.Errors and the regular VBA Err object.
This error occurs whether or not the file msrdo20.dll exists.
I found
https://support.microsoft.com/en-us/kb/260369
which says to include ODBCDirect, but that doesn't seem to be relevant.
I found
http://www.xtremevbtalk.com/archive/index.php/t-172385.html
which suggests removing Microsoft DAO 3.6 from the references and switching to DAO 3.5 -- but doing that breaks things even worse, I get run-time error 429, "ActiveX component can't create object".
This is Windows Server 2012, Excel 2013.

This blog solved that problem for me:
http://pwaldman.com/unable-to-load-msrdo20-dll-or-rdocurs-dll/
Extract:
Resolution
Download Service Pack 6 for Visual Basic 6.0 (Vs6sp6.exe)
http://www.microsoft.com/en-us/download/details.aspx?id=9183
Run Vs6sp6.exe and extract the files
Open msrdo20.cab, it contains the following files: MSRDO20.DLL, MSRDO20.INF, and RDOCURS.DLL. Extract all three files and copy them to the C:\Windows\SysWOW64\ directory.
Open an elevated(admin) command prompt, navigate to C:\Windows\SysWOW64, and register MSRDO20.DLL. The RDOCURS.DLL does not need to be registered.
C:\Windows\System32> cd C:\Windows\SysWOW64
C:\Windows\SysWOW64> regsvr32 MSRDO20.DLL

I had forgotten to run my command prompt as administrator when I used regsvr32. That's why VBA wasn't able to find the DLL.

Related

Error : -7132: An error occurred streaming ISSetup.dll support file Script Files\Setup.inx

I have installscript in Basic MSI Installshield Project which works perfectly when using InstallShield 2015 IDE. But, when using Installshield cmdline on a separate machine, getting this error -
"Error : -7132: An error occurred streaming ISSetup.dll support file
..\Script Files\Setup.inx" .
All the necessary files are in place for building Installshield project.There are other projects which are using same installscript and running absolutely fine using Installshield cmdline on the same machine.
Any help would be appreciated.
Thanks
Well, the separate machine is a different environment.
Different environment, different file locations.
That kind of compilation error is usually related with link files problems. Like a linked rul not available.
Check the relative links to every .rul in your project, specially if you have custom .rul files.

Using interop.MSProject.dll without Office installed or creating Project Add-in in Visual Studio

I need to work on Project Server using Microsoft.Office.Interop.MSProject.dll from Visual Studio.
Using gacutil.exe I have registered Microsoft.Office.Interop.MSProject.dll and at folder "C:\Windows\assembly" there is entry for MSProject.dll whose processor architecture is MSIL.
I have created Console Application and when I try to create Application instance it gives error:
Class not registered-HRESULT: 0x80040154 exception. As shown in image.
Target platform for this project is x86(32-bit). What could be the reason for the error?
Is it because office is not installed on local machine? Is there any alternative to using PIA without installing Office?
I have tried creating Project Add-in from Visual Studio, it works successfully, but it requires Project Professional to be open, which I want to avoid. Is it possible to avoid opening of Project Professional application in this case?
You need to have the Application (i.e. MS Project) installed on the PC. Interop files sre used for marshalling property or method calls from a managed code to the host application.

HRESULT 0x8007006E on including a DLL into a project 'lib' folder

For a project I am working on, my team generates reports on the server with ActiveReports. We've generated a License DLL that allows report functionality to work.
In our VS2012 solution, we've included a /lib/ directory that holds certain external DLLs, such as the ActiveReports assemblies and this license DLL.
However, upon attempting to add the DLL to the project, we get two errors, back to back. I attempted to add the extant DLL using these steps:
In VS 2012, right click our /lib/ folder, and click 'Add Existing Item...'
Browse to the Windows directory where the License DLL Is and select it, click Open.
Upon doing this, though, I receive two errors back to back:
Could not open the file
The system cannot open the device or file specified. (Exception from HRESULT: 0x8007006E)
I have checked my local operating system permissions to ensure that the folder the DLL lives in is accessible, and that the path of the object that appears in VS 2012 points to the correct place. Question: What is causing this error? Surely, I'm missing something...
I received the same error trying to open a file with VS's binary editor. The file was already open in another app. After closing the other app and I was able to open the file in VS without error.

F# Script SharePoint 2010 API doesn't work

I am trying something really simple in F# to try and test interaction with the SharePoint 2010 API. I think I am running into a general problem with F#. Is there anyway that an F# script can access the SharePoint 2010 API?
I think my problem is due to the F# scripts running 32bit, and the SharePoint API is in 64bit.
An example of the code I'm trying to run is as follows:
#r "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\Microsoft.sharepoint.dll"
#r "System.ServiceModel.dll"
open System
open Microsoft.SharePoint
let GetListByUrl (listUrl:string) =
use site = new SPSite(listUrl)
use web = site.OpenWeb()
let list =
if not (web = null) then web.GetList(listUrl)
list
In the visual studio editor it says the following error: The Type System.ServiceModel.ChannelFactory`1 is required here and is unavailable. You must add a reference to assembly ...
When the script is ran it gives the message: System.IO.FileNotFoundException: The Web application at... could not be found. Verify that you have typed the URL correctly...
Which is the error message I get if I try to access the SharePoint 2010 API from a 32bit c# console program. If I change the c# console program to Any CPU that message doesn't appear.
However I'm trying to do this in an F# script which I guess is 32bit, so how would I work around that?
Also since this is probably a general problem with F# scripts and 64bit dlls, how would you work around the problem of needing to reference 64bit dlls in F# scripts?
Edit
I used corflags.exe in the visual studio cmd prompt to modify the fsi.exe to 64bit. I followed this guide: http://ig2600.blogspot.com/2010/05/making-fsharp-interpreter-fsi-run-in.html. That seemed to work, though the F# interactive window seemed slower. However when I ran the code above in the now 64bit fsi it said sharepoint does not work with .net 4.0. How would you run the F# interactive window in .net 3.5?
Edit
Because of the answer posted by F.Aquino in which he said I needed to add a reference to System.ServiceModel I have updated the code to add that.
That fixes the visual studio editor complaints that keep appearing with red squiggly lines everywhere. When the script is ran the results are the same, the script cannot access the sharepoint 2010 API which is the problem I am having.
You need to add a reference to System.ServiceModel

Publishing Web site without installing Microsoft Report Viewer

I have a web server with ftp access only, and I can't install Microsoft Report Viewer on it.
How do I publish my asp.net app to the IIS without installing ReportViewer?
I have copied following dlls to my site bin folder:
Microsoft.ReportViewer.WebForms.dll
Microsoft.ReportViewer.Common.dll
Now I am getting error saying:
An error occurred during local report processing.
The definition of the report 'Reports\QuotationViewReport.rdlc' is invalid.
An unexpected error occurred in Report Processing.
Could not load file or assembly 'Microsoft.ReportViewer.ProcessingObjectModel, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
I can't even find a dll named Microsoft.ReportViewer.ProcessingObjectModel.dll in my local machine.
Is it possible to publish my application without installing ReportViewer ?
Pre-requisite : having Microsoft ReportViewer assemblies installed on your development machine (as answered by webkite).
In Visual Studio, from the Add Reference action of your project, choose browse tab and browse to the GAC.
(C:\Windows\assembly\GAC_MSIL).
There, find the Microsoft.ReportViewer.ProcessingObjectModel assembly folder, choose the version sub folder suitable for your needs, and add the assembly as a local reference.
Then locate the assembly in your references list, and switch its Local Copy property to true.
For other report viewer assemblies, you should be able to add them directly from the .Net tab in Add Reference dialog box. Do not forget to switch the Local Copy property to true for them too.
With this setup, the ReportViewer assemblies will be copied to your build directory at each build, and you should be able to copy them easily to your target deployment environment.
You may instead try some of the ReportViewer packages than can be found on NuGet. But none of them seem officialy provided by Microsoft.
Download & Install
Microsoft Report Viewer 2010 Redistributable Package
http://www.microsoft.com/download/en/details.aspx?id=6442
Add these files to your website's bin folder:
Microsoft.ReportViewer.Common.dll
Microsoft.ReportViewer.WebForms.dll
Microsoft.ReportViewer.WebForms.xml
This is now available as a NuGet package:
http://www.nuget.org/packages/Microsoft.ReportViewer.WebForms/
Install-Package Microsoft.ReportViewer.WebForms
try C:\Windows\assembly and search for Microsoft.ReportViewer.ProcessingObjectModel
Or
You can find ReportViewer.exe at the following location: C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\ReportViewer\ReportViewer.exe
after you run ReportViewer.exe, the file will copied to the Global Assembly Cache folder on the deployment computer
hello you can find the dll file open your project
and add refrences and choose browse and select c:/windowse /assemple/GAc_msil
here you find microsoft report viewer folders and select what you want

Resources