1- no, the SQL Server code sends the messages to the intended recipients, but it doesn't maintain a queue and doesn't retransmit.
2- yes, the code inside the SQL Server trigger must know which clients to send the message to.
3- no, SQL Server sends and doesn't care who receives.
4- the client side might not be running, and the message addressed to it would be lost.
5- 'ramification delay' I don't understand what you mean
Sorry, but I don't understand "..but I believe the label on the can you just opened reads 'Acme Worms'."
"Opening a can of worms" means to create a complicated, unpleasant, or difficult situation by doing something that leads to many new problems. The phrase is a warning that an action, though perhaps intended to solve one issue, will likely result in a tangled mess of new complications that are difficult to control. The idiom alludes to the messy, unmanageable jumble of worms that would come out of a literal can.
1. Then there is no feedback to acknowledge receipt. You have no way to know that ANYONE saw ANY message.
2. Is this list mutable? Can you easily add an employee to get these messages AFTER this solution is deployed? How easy would that be? (In your design in your head that you are working from.) Can you REMOVE an employee after deployment? Have you considered this kind of maintenance?
3. Then basically you could have a case where everyone on the list was elsewhere at that time and nobody saw anything. And when nothing gets done correctly, the intended recipients later have plausible deniability that they didn't get the message.
4. Then when nobody is listening, nobody heard the tree that fell in the forest and no one will hear its echoes.
5. OK, if you don't like "ramifications", try "consequences". If you want to know that the message went out to the intended recipients, you need a feedback mechanism. If you don't have a feedback mechanism, then you obviously don't care whether someone gets notified. So my solution is don't send any messages in the first place, since you don't even care to verify that they are received.
Basically, your words tell us that you have overspecified this messaging requirement because you have no feedback loop to verify that the messages went through. This "asynchronous notification" method doesn't need to know anything at all. Which means NONE of your specifications are self-consistent. You might as well have NO messaging. Heck, polling would be more reliable than what you just described. I don't give a raspberry about "no polling" because your specification is so inconsistent that it might just as well be "no messages."
I reiterate that you might as well use SMTP-class mail to the person, NOT to the application, because as lax as the feedback seems to be in your problem description, ordinary e-mail will do just fine.
The common phrase you didn't understand is "opening a can of worms". It implies starting a project which will be extremely complex, with many parts and difficult relationships. Gets worse when the phrase is "bucket of worms" since some of them might still be alive and therefore still moving when you pour them out of the bucket. This is the Google Gemini definition:
"...how can we 'notify' the executing Access procedure that the ARTICLES table at the row ARTICLES_ID=12345 has been modified?..."
My question focuses on how to "enter" the message recipient's Access code
the client side might not be running, and the message addressed to it would be lost.
Receive_Command is defined? It is not one I have come across. I can find more than a couple of places where Receive (without the _Command suffix) is a defined function. But how that is any different than either a pending I/O on a network channel or polling. Everything I looked up with several web searches targeting Windows environments lacked any knowledge of that specific function. That makes it really hard to evaluate your intent.Don't worry! - you simply wanted a non polling event - other issues are not your goal here!The user's behavior has no bearing on the request
The question is: "...how can we "notify" the executing Access procedure that the..."
The operator could be at the desk and react in some way to the message
Or they could not be there
Or the computer could be turned off
None of these three conditions has any bearing on the initial request
What is relevant is the initial request
import socket
import win32com.client
def chiama_access(comando):
try:
access = win32com.client.GetObject("c:\erp2\erp2_x64.accde")
access.Run("Ricevi_Comando", comando)
except Exception as e:
print("Errore nella chiamata ad Access:", e)
def start_server():
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(("0.0.0.0", 12345))
s.listen(10)
print(f"Server TCP in ascolto sulla porta 12345...")
while True:
conn, addr = s.accept()
data = conn.recv(1024).decode("utf-8").strip()
print("Ricevuto:", data)
chiama_access(data)
conn.close()
if __name__ == "__main__":
start_server()
May I ask in which contextReceive_Commandis defined? It is not one I have come across. I can find more than a couple of places whereReceive(without the_Commandsuffix) is a defined function. But how that is any different than either a pending I/O on a network channel or polling. Everything I looked up with several web searches targeting Windows environments lacked any knowledge of that specific function. That makes it really hard to evaluate your intent.
Agreed, it would be trivial to initiate some kind of transmission from a data trigger in an SQL Server database. The "can of worms" I referenced earlier IS, as you said, on the receiving end. The wormy part is doing this on the Access end, compounded by the fact that you have to have two things going on at once, BOTH of which must act independently.
In that receiving end, one thing is whatever data entry/edit/update form your people use to do their daily work. One would presume that this part would be relatively easy, with the exception of notifications.
The other would be the separate "listener" that does something to make connections so that at appropriate times it would notify the people that something needs to be done. You talk about writing something in python or C# or something else that can update something. But... (I hear the can opener)
You said this has to notify the Access app, or at least that was the takeaway that I got from your discussions. If your data alerting the main users is updated via python or C#, you STILL have not addressed how to cross task boundaries, because that task will be a different task than Access and the Windows cross-task influence rules will get (still be) in the way.
If you update a BE table with this notice, you are back where you started. It is going to come down to having something in the FE that will respond to an event so that the FE will show it, OR my suggestion to send a MAIL notification (which doesn't have to diddle with the FE at all).
If you have a "local" table in the FE, you need that data update event to have something to intercept the event from inside the FE - but now you have to consider how this would be done because you need to notify each active task. And we come back to behavior when some users are running your app but others have walked away from their desks for personal or business reasons.
After some research, I came across that it would be possible to execute a remote instance of MS Access Using PowerShell, so you could execute that instance using /cmd command to execute whatever task you wanted.
It's not a piece of cake, but it seems it's a real possibility (I've never tried it)
@echo off
REM Avvio remoto di erp2_x64.accde su PC2 con parametro
set REMOTE_PC=PC2
set USER=NomeUtente
set PASS=Password
set ACCESS_PATH="C:\Program Files\Microsoft Office\root\Office16\MSACCESS.EXE"
set FILE_PATH="C:\erp2\erp2_x64.accde"
REM Parametro passato al programma
set PARAM=%1
REM Avvia il programma su PC2
psexec \\%REMOTE_PC% -u %USER% -p %PASS% %ACCESS_PATH% %FILE_PATH% /cmd %PARAM%
Public Ricevi_Comando(byval command as string) as string
Is a function inside a standard module of the erp2_x64.accde program
.... by which time you may as well use polling....
Are you saying that /cmd isn't usable if the remote location already has an active Access instance?The problem with the /cmd switch for this situation is that is does not work if the target accdb is already running.
Did you look into it and if yes, what are your conclusions? (If this was already mentioned in the thread, I must have missed it.)So it all seems to be based on this 'service broker'
Yes, that's what I was looking for. I'll try to look into it now.