Send message to specific user from Access Database

I have a database named AutoUpdate. The function is to pull data from a standalone database on a remote pc. If for some reason the routine to pull the data cannot run (network is down), I want the program to alert specific user(s) to the problem. I am trying to use msg.exe to accomplish this task. So far, I have not been able to do so. I have tried using Shell and pstools psexec to accomplish task.
Below is code I have tried so far.
The first code does not run because there is not a password.
The second code asks for a password. When password is entered, a second command prompt opens, code ends, no message.
The third line of code appears to work. However, I get two cmd windows. The first tells me than I am running "Execute Procedures remotely. The second is just blank.
 
    Dim strUser, strMessage As String
    Dim objShell As Object
    Set objShell = CreateObject("WScript.Shell")
   
    strUser = "wilbur.smith"
    strMessage = "Hello"
   'Check to see if the file is available
   If Dir("r:\!a\abc123.txt") <> "" Then
       
    Else
        'File not found
        'objShell.Run ("cmd /k c:\windows\system32\msg.exe * /server:" & strUser & " " & strMessage)
        'objShell.Run ("runas /user:domain\UserName ""C:\Windows\System32\cmd.exe /k C:\windows\system32\msg.exe * /server:" & strUser & " " & strMessage & """")
        'objShell.Run ("cmd /c c:\pstools\psexec -u domain\username -p Password cmd /c msg * /server:" & strUser & " " & strMessage)
    End If
LVL 1
rodneygrayAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dale FyeCommented:
I use a 3rd party program called vbMapi to avoid the Outlook security messages.  If you want to continue to use Windows  tools for this, I would suggest you "request attention" and ask the moderator to add the appropriate Windows topic to your topic list.

Dale
0
ste5anSenior DeveloperCommented:
How should that work when the network is down? Then the message cannot arrive and the user thinks everything it's fine.

You need to post always a message. So that no message means: Oops. Network issues.
0
Boyd (HiTechCoach) Trimmell, Microsoft Access MVPCommented:
If the network is down then  how can you send a message over the network?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

rodneygrayAuthor Commented:
Sorry, I did not give you enough information. There are two remote pc's connected back to the office via wireless point to point. The database will be pulling information from the two remote pcs. Sometimes the remote pcs are down for some reason. Sometimes the wireless may have an issue. The rest of the network is fine.
Anyway, I came up with a workaround. I have semi-tested it and I think it will work.
From within Access,
Check to see if Station1Unavailable.txt, Station2Unavailable.txt exist
   Yes: Delete files
Check to see if the database can be seen (does it exist).
   Yes: If so, new data is uploaded.
   No: Create one or both: Station1Unavailable.txt, Station2Unavailable.txt

On the server
   Create a batch file which checks for existence of both of these files
   If one is found, batch file uses msg.exe to send message to specific users

Create task to run the batch file
  Schedule task to run every hour of every day
  Task uses credentials added when the task was created.

Not as elegant as I would like. Not very flexible. But, it will work.

If anyone has a better way, please let me know.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dale FyeCommented:
strongly recommend against trying to use Access across a wireless network.  Access is very temperamental  with respect to the connection between the Front End and the Back End and wireless networks do not provide consistent, persistent connections.  You will inevitably have problems with lost connections and database corruption if you persist with this technique.
0
rodneygrayAuthor Commented:
Did not receive any other solutions and this one works.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.