Remote and control access file on other computer with the same Lan network (1 Viewer)

Lucii

New member
Local time
Today, 17:46
Joined
Dec 27, 2023
Messages
3
Hi all.
I am a new member of this helpful forum.
I facing with my problem and hope anyone could give advice as following:
One PC with name as PC1, and other as PC2. Pc2 has created a Shared folder and given full permission.
A database as \\SharedFolder\SendEmail.accde in shared folder located in PC2 that allows user send email outlook with curent default email user.
a database in PC1 located in desktop with form, query.
Two databases are FE with same BE.
My target is that uses FE in PC1 to run task vba that FE in PC2 send email on PC2.
Thank you and look forward to hearing from you.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:46
Joined
Oct 29, 2018
Messages
21,473
Hi. Welcome to AWF!

One idea you could try is to add the shared app ad a reference to your other db.

Just a thought...
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 05:46
Joined
Feb 28, 2001
Messages
27,186
A little clarification might help. We need to know a little bit about your environment in the PC2 setup in order to know better how we might direct you.

Does the PC2's FE send the e-mail from a form or a macro or something else?
Does it create an Outlook application object in VBA code OR does it do a DoCmd.SendObject?

Tell us about the PC2's shared SendEmail.Accde, about how it works. That will help us to help you.

By the way: Since that is also your first post, welcome to the forums, Lucii.
 

Lucii

New member
Local time
Today, 17:46
Joined
Dec 27, 2023
Messages
3
A little clarification might help. We need to know a little bit about your environment in the PC2 setup in order to know better how we might direct you.

Does the PC2's FE send the e-mail from a form or a macro or something else?
Does it create an Outlook application object in VBA code OR does it do a DoCmd.SendObject?

Tell us about the PC2's shared SendEmail.Accde, about how it works. That will help us to help you.

By the way: Since that is also your first post, welcome to the forums, Lucii.
Thank for your reply.
My pc2 FE send email from a macro with a button called cmd_sendmail, and macro will create outlook Object whenever User click the button.
The macro will get information from table (To, Cc, subject, body content,...) and take a loop through record and create and send mails. Each time macro will send about 100 emails.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 05:46
Joined
Feb 28, 2001
Messages
27,186
So you are saying that within the SendEmail.ACCDE file, you create an Outlook object (at run-time), after which you loop through recordsets one record at a time to create mail objects that are dynamically built and sent once one has been constructed. And you use the Outlook object's SEND command to trigger each message transmission.

Does any part of the message depend on the identity of the user who clicks the button? The problem that bothers me is that it might be possible to create a reference to the remote (PC2) DB file, and you could even activate the routine to do the send (perhaps), but I'm not sure how the remote user's ID on PC1 would become available on PC2 unless they were using domain-based IDs. Is this a domain environment?
 

Lucii

New member
Local time
Today, 17:46
Joined
Dec 27, 2023
Messages
3
So you are saying that within the SendEmail.ACCDE file, you create an Outlook object (at run-time), after which you loop through recordsets one record at a time to create mail objects that are dynamically built and sent once one has been constructed. And you use the Outlook object's SEND command to trigger each message transmission.

Does any part of the message depend on the identity of the user who clicks the button? The problem that bothers me is that it might be possible to create a reference to the remote (PC2) DB file, and you could even activate the routine to do the send (perhaps), but I'm not sure how the remote user's ID on PC1 would become available on PC2 unless they were using domain-based IDs. Is this a domain environment?
Dear the_doc_man
User on pc1 has all authority to control pc2 with user and password. Sometimes, user pc1 uses remote desktop control (default app in win10) to remote Pc2 and pc2 is always turn on.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 05:46
Joined
Feb 28, 2001
Messages
27,186
Using RDP means you actually have a session on (and thus local to) PC2, thus you have everything you need right there to trigger your desired action. But you were asking about using VBA. That means you have to work with application objects.

Using the database on PC2 as an application object is very different from using RDP. My concern for this part of the problem is over the "control" channels that drive every Access session. Using RDP, your PC2 application's keyboard, mouse, and display channels are used more or less normally but are re-routed via a Windows network connection to the remote machine's keyboard, mouse, and display.

This is not true for application objects and is why I have some uncertainty in the approach. If you can remotely open the database (not via RDP, but run an OpenDatabase operation in VBA) then you have two databases open at once and can perhaps can directly trigger the code you want.

or

The trick is that if this code that you want to run is behind a button, that means it is behind a FORM as well. So you might have to open the form (also through VBA) to assure that the _Click event code is even available, since that class of code is not loaded to memory unless the correct class member (the form) is also loaded.


Then, rather than trying to actually click the button, if you could make the button_Click event entry point public, you could just call it from your PC1's VBA code. If you DON'T have the ability to make that code public, though, you might be in somewhat of a tight spot here.


IF the identity of the user clicking that button is at all significant (beyond merely having permission to do it in the first place), there is where I am a also a bit uncertain, and there I have to admit I am out of my depth on this fine point.
 

Users who are viewing this thread

Top Bottom