How to run a COM .dll on a remote server? - com

I have a legacy 3rd party COM .dll that is used to provide an Excel-callable interface to a proprietary database product. The .dll runs on the same physical machine as Excel. I have a need to execute the .dll (and the database it is calling) on a remote server while still maintaining simple Excel callability from the client. I'm totally confused by all the different MS technologies that seem to hint there is an easy way to do this. Can someone please point me in the right direction (easier is better)?

There are 3 steps:
Register the COM DLL on the remote server.
Tell COM to go to this server to find the COM DLL.
Configure security.
In order for a COM server that is a DLL to run in its own process, it needs a COM surrogate (see MSDN).
In Excel, if you use VBA to get at the COM DLL, the CreateObject method has an optional parameter that is the machine where the server is located, which is exactly what you need.
If you do not use VBA, I am afraid that you need to write a proxy server that forwards the calls to the real server. I could not find a way to do this by configuration.
Use component services on the remote server to setup security, so that users from Excel can launch and use the COM server.

Related

How do I use a SharePoint List as a Data Source?

I'm creating a VB-based application in Virtual Studio 2013, and up until now I've been testing the tables used for its operation in a local MDF file. Obviously, I need to find a better solution for deployment as this will need to be used by multiple users. I decided to go with a SharePoint list for ease of access and better local control. (We have SharePoint Server 2010 running)
When I try to add a SharePoint Connection in the Server Explorer, it tells me I don't have Foundation or Server installed. Checking our corp's software request tool, I didn't find either of those. There's a 'SharePoint Designer' option, and another that sounds promising is 'Microsoft SSIS SharePoint List Adapters with SharePoint'. I couldn't find any info online about whether those would fit the bill. Would either of those serve the purpose of standing in for Foundation or Server? If not, I'm sure I could find a way to request Foundation but I'm sure that would add quite a bit of delay while they vet it for business use.
Also, if I install the necessary software for development on MY machine, will those dependencies be included in the executable so my clients wouldn't have to install those SharePoint tools as well?
If you want to access and manipulate with your sharepoint list from your code, you can look at Sharepoint CSOM. It allows you to remotely connect and proceed CRUD operations with sharepoint list.

How do I Execute Visual Basic Exe and Crystal report in LAN

Hi I have a Visual Basic Project Exe which runs fine on a Single Machine i Want it to be Execute for Multi User in LAN. I Have Used Crystal Reports in My Project and database is MS Acess. Please Help me how run the Project in LAN..
A VB EXE is a client architecture which usually needs installing on each client machine using it. The code in the EXE could/would normally then connect to external shared, singular resources over a network (such as databases, reporting servers etc.) but the actual EXE itself would typically be duplicated upon each client computer.
If you need all the users to open the exe and have it always run on the same machine, then you could create client shortcuts or use a script with a CreateObject("application.NameHere","serverToRunAppOn") call &/or modify the DCOM settings for the app through the dcomcnfg tool...
However I'd sugguest instead re-evaluating your architecture. Possibly turning your app into a better practice web-based or MS Access shared MDE+MDB solution for clients to connect to.

Remote cocreate call "Class not registered"

I have read everything I can find on the net about "class not registered".
I have a vb Com dll which I have installed on the server.
(I did not write the DLL an don't have the source) The server is 64 bit
I have a 32 bit program (Delphi7) on a 64 bit machine.
The program does a cocreate with the server name and gets a "class not registered".
If I put the program on the server and run a cocreate it works, the class is registered.
In desperation I did an install of the DLL on the local PC and the cocreate works
I checked the registration on both machines, it is identical, and the registry
HKEY_Classes_root_wow6432Node\CLSID\ on both machines has the registration GUID.
The setup/registration process on each machine being identical.
Why does it create when the call is local (on both machines) and not when the call is remote?
It would seem that the remote call from PC to server even though from a 32 bit program is being seen by the server as a 64 bit call.
Note: the server is a virtual server, does this make a difference?
Any help much appreciated.
The server has a program called Pastel Partner which uses Pervasive Btrieve
The VB6 DLL (and associated DLLs) are simply a separate program which can be accessed via the interface to provide certain functions like an input of an accounting entry into the Btrieve Files instead of typing it into the Pastel Program.
My program starts of course with a create of the interface, which seems to work if My program (32 bit) is run on the server as createobject(class), but not when it is run on a remote PC with the server name.Createobject(class,server) when the class not registered occurs.
It is the server which is a virtual server.
Local and Remote are different. To access remotely, you have to grant access.
I didn't quite get your problem and I have no idea what server you are using so if this will help, click for details... https://rtcamp.com/tutorials/mysql/remote-access/
or you can specify your search methods like how to remotely access "database" and whatnot.
If your problem is not really the remote access on your database then try this. This might be of help. http://www.theogray.com/blog/2009/10/comexception-regdbeclassnotreg-on-64-bit-windows
P.S. If you are using virtual machine, it is already considered like using a different PC.

Registering an interop dll on Windows Server 2008 R2

I have searched all over StackOverflow and the internet for help with this. This is a very commonly asked question and I have tried everything that I could find and still no success.
The problem is that my company wrote their own encryption dll several years ago. It is now considered obsolete in the company but we are a small branch of a larger corporation and we use this on our classic ASP intranet web site.
We are in the early stages of migrating our web site to a Windows Server 2008 R2 virtual server.
Most every web site I found said the same thing. Go to C:\Windows\SysWOW64 and run regsvr32.exe in a command box. I have done this with the dll in a separate folder and I have done this after the dll has been copied to the SysWOW64 folder.
Each time I get an error message and the messages are not always the same. The message du jour that I am getting is:
The module "Interop.MyEncryptionTool.dll" was loaded by the entry-point DllRegisterServer was not found.
Make sure that "Interop.MyEncryptionTool.dll" is a valid DLL or OCX and then try again.
I do not have the source code of the dll nor do I think anyone in the company has it. I wrote my own encryption dll in VS 2008 in VB.net and it works fine but we decided that even though the company considers their dll obsolete it is still a standard. The company never created an updated version to replace this dll.
At this point I am wondering not so much how to do this but is it even possible. Did 2008 R2 drop compatibility with older Active-X, COM or COM+ dll's?

Databases, Office and Visual Basic.NET

I'm currently writing a program which will need to incorporate writing its output to a database rather than flat text files.
I know that if you use a Database system like SQL Compact, when you build and publish the program (or just build and distribute), your client will have to download and install SQL Compact Server.
My question is:
When using the built in Microsoft Office exports (like writing a Word File, or Writing an excel file), does the client need to have Microsoft Office installed on their machine to make use of these?
When writing to an Access Database, does the client user need to have Microsoft Access installed on their computer?
I'd appreciate any response.
Yes to Excel. You could create the Access database via ADO or ODBC, and that comes with Windows itself. You could store data from your app there, and the clients would use it through your app (or any other that can connect via ADO/ODBC).
Using the MS Office COM automation requires that the MS Office product be installed on the machine running the automation.
There are third-party code libraries that replace that functionality with their own code, meaning your app could create it's own Excel-compatible files. However, your users would still need Excel to use them.
You can also use other databases (eg., MySQL, Firebird, SQLite, and others) that are available that wouldn't necessarily cost your client anything if they installed it (or, for some, if you included it in your installation for them).