- Local time
- Today, 17:03
- Joined
- Feb 28, 2001
- Messages
- 30,158
It's beer O' Clock anyway!
In the New Orleans French Quarter post-COVID, it's ALWAYS Beer o'clock.
It's beer O' Clock anyway!
Check out the Access.Application.Run method. Your C# ccde can directly execute code in an an Access.Application object.I have available the C # procedure that 'sees' all the messages passing through the server
And i can modify it to do other operations
doesn't work on x64?
Too hot?? In the UK?!!?!
New Orleans has been running 90+/90+ lately.
https://codedocu.com/Details_mobile?d=2075&z=1&t=Code%3A+Create+your+own+ActiveX+Component+in+Visual+Studio+2017+and+Office+2016+365
https://www.codeguru.com/csharp/.net/net_general/comcom/article.php/c16257/Create-an-ActiveX-using-a-Csharp-Usercontrol.htm
https://stackoverflow.com/questions/49469926/using-withevents-in-vb6-with-net-vb-dll
As i am also quite interested in the topic, here is a usefull link that can definitely be of use.For the benefit of those interested in the subject I would like to share the results of my research at the present time
Public Function Listener(Arguments As DataType)
'Your Code here
End Function
oAccess = new Access.ApplicationClass();
//To my knowledge this will get the current instance if already opened
oAccess.OpenCurrentDatabase("C:/File/Path/To/My/Database.accdb");
oAccess.Run "Listener", ArgumentsHere
public class callableClass
{
public int callableMethodSimple(double a)
{
return (int)a;
}
}
'VBA code
Public cssObject As New SendArray.callableClass
'SendArray is the name of the project in which callableClass resides.
Sub MyRoutine()
Dim result As Integer
result = cssObject.callableMethodSimple(5.0)
End Sub
oAccess = new Access.ApplicationClass();
oAccess.OpenCurrentDatabase("C:/File/Path/To/My/Database.accdb");
oAccess.Run "Listener", ArgumentsHere
oAccess.OpenCurrentDatabase("C:/File/Path/To/My/Database.accdb");Yes the code
Code:oAccess = new Access.ApplicationClass(); oAccess.OpenCurrentDatabase("C:/File/Path/To/My/Database.accdb"); oAccess.Run "Listener", ArgumentsHere
Yes, the code indicated is definitely working
But it is not suitable for communications that must take place quickly
The loading of the Access instance is very long, we are talking about seconds, if compared with the need for rapid reaction to the commands sent from the outside to the Access procedure
For this reason in my post I indicated that it is the simplest way (vbs script) because it does not in any way affect the code of the main procedure in which the command is 'injected'
But it is also the worst method in terms of reaction times