Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Barlow is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2013
    Posts
    10

    Unhappy Access Crash on "EMailDatabaseObject" on Terminal Server/RDP

    We have a Purchase Order database that sends an Email to someone when the Form is submitted via an Event Macro on the 'Submit' button (EMailDatabaseObject). This works well on PCs within the LAN, but for users on RDP, the Form hangs after the Email has been created (ie, when the user returns to Access, they have to force Access to Close as it's totally hung). Again, this only happens on RDP. Has anyone else experienced this issue? Anyone have any idea how to fix it?



    Many thanks for any help or advice.

    Brian

  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    I will presume that Access via RDP doesn't know the process status of the email event. Try putting in a 'form close' or perhaps a form requery statement immediately after the email send statement. This is only a wild guess. I am thinking that the email works and so immediately after that statement if you force the database to "move on" so to speak and not await further email interaction - that it might stop it from hanging....

    would be interested to know what you find out....

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    The RDP client may not have privileges to access the MyDocuments folders where Outlook has its .PST

  4. #4
    Barlow is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2013
    Posts
    10
    Thanks for your replies. I actually used to have a Close Event but removed it because I thought that was the problem. Just a reminder, this works for everyone on the LAN. It's only RDP users that this affects.
    'It'sMe'. On RDP, there is no .PST or .OST. Clients work 'online' with Exchange.

    Thank you for your replies though. Any other thoughts?

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    It seems like an issue with security settings. I would start with the RDP host machine. On the RDP host, set the permissions to allow full rights where needed. There are settings for Messenger and RDP client connections.

    If the problem still occurs.
    Get with IT and see if they have a Group Policy for RDP clients that will allow Relay with the SMTP server.

    Another option would be to use a different SMTP server within your VBA. You can authenticate to another SMTP server using CDO schemas. This will bypass Outlook App and Exchange. Post # 7 in link shows example code.
    https://www.accessforums.net/access/...ess-38401.html

    You might be able to spoof Exchange using the CDO schema for SMTP authentication, if it is Exchange that is blocking the RDP session.

  6. #6
    Barlow is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2013
    Posts
    10
    Thanks ItsMe. I maybe didn't clarify, but Outlook does work, ie, when people click 'Send' in Access, Outlook opens, and people can send the message. It's only when the user returns to Access that it's unresponsive. Do you think your suggestion around GRP, etc, is still the issue? Thanks again for taking the time to help us.

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    While in RDP, can the user go to Outlook, create and send messages? Can they do this independent from Access? If they can successfully use outlook while in an RDP session, then maybe it is not a security issue. Go ahead and post your code here for the Email procedure. Enclose the code in tags Code and /Code enclose in tags in "[" brackets

  8. #8
    Barlow is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2013
    Posts
    10
    Yes, all users can use Outlook no problem. It's not code, it's a Macro. Do you think converting it to VBA would help?

  9. #9
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Well, I wouldn't know where to begin to trouble shoot macros. The fact that the program is just hanging makes it all the more difficult. Using VBA might help indicate where a problem is via debugger.

    It seems the macros are in the DB file that the RDP session is opening. Otherwise, it would not launch the email.

    If this was my project to fix, I would replace the macros with VBA. But, I am comfortable with VBA and not comfortable with most macros. You may get more help here if it was in VBA. There are no guarantees using VBA will help to shed light on the problem. The debugger might not launch. You may get the same symptom.

  10. #10
    Barlow is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2013
    Posts
    10
    If I try to guess the VBA, this is what I get:
    DoCmd.RunCommand acCmdSaveRecord
    DoCmd.SendObject (acSendReport, "New PO for Approval", HTML, ,,, "New Purchase Order for Approval",, Yes,,);

    But this gives me a "Compile Error - Expected Expression". Have I missed a comma or something?

    Many thanks

    Brian

  11. #11
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    See if this example helps. The "True" value at the end will prompt the email message to pause and cause the User to review and manualy send the email by clicking "Send"


    Code:
    DoCmd.SendObject acReport, "rptNameofReport", "PDFFormat(*.pdf)", "ToEmailAddress", "CcEmailAddress", "BccEmailAddress", "Email Address Subject Line", "Text to Include within Email Body", True

  12. #12
    Barlow is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2013
    Posts
    10
    Thanks. I missed the True at the end.
    I'd prefer it as HTML, as PDF creates a 346Kb File. Do you know the Format for HTML instead of PDF? I tried Googling it but am having no luck and am wasting ages. If you know, great; if not, then thanks for your help so far.
    Brian

  13. #13
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Have you tried leaving it blank? You want to keep the commas, just remove the "PDFFormat(*.pdf)" part

    I am going to guess it will default to your Outlook settings. I really don't know. One of the first steps is to see if this works in RDP. Try it without including a format. If it works, great. If not, test it in RDP anyway. There is other VBA that can be used by creating various Outlook objects. We can try this alternative VBA if the RDP session continues to fail.

  14. #14
    Barlow is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2013
    Posts
    10
    It brings up a Dialog Box, asking what format, which I don't want users having to select, so I'll just leave it as PDF if we can't get the HTML Code.
    It does seem to have worked, ie, VBA instead of MS' crappy Macro. It worked for me. I'm just going to ask some other users to test it.
    Thank you for your help.
    Have a great weekend.
    Brian

  15. #15
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    OK, there must be a way to insert the format in the DoCmd. I just don't know because this cmd is not something I use. I use older methods, mostly because I am old. I will keep an eye out. Maybe someone can post it here. At least we know you can use RDP and for sure we will be able to get it to format how you want.

    If we don't find a solution for the DoCmd, we can use the other code and create the Objects, spelling everything out.....

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 06-24-2013, 07:12 AM
  2. Replies: 12
    Last Post: 05-23-2013, 10:56 AM
  3. Replies: 2
    Last Post: 11-14-2012, 04:47 PM
  4. error "OLE Server isn't registered"
    By newtoAccess in forum Forms
    Replies: 1
    Last Post: 12-26-2010, 10:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums