Re: MSAccess Runtime Error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tom van Stiphout

    Re: MSAccess Runtime Error

    On Thu, 30 Oct 2008 11:04:44 GMT, "JOHNNY OUTING" <outingjr@att.n et>
    wrote:

    You managed to violate several netiquette rules in one post. Please
    review http://www.mvps.org/access/netiquette.htm
    This is a text-only newsgroup (you could have captured the error
    message with Ctrl+C), and if you can't be bothered to check back for
    messages, why would we make the effort to answer in the first place?

    RunCode is designed to call a public FUNCTION, not a sub.

    Also make sure you check the results of CreateObject; don't assume it
    works:
    if appOutlook is nothing then
    Msgbox "Aarrrrcchh h, Outlook not installed?"
    else
    Set MailOutlook... etc.
    end if

    ..To takes a string, like "mailbox@domain "

    -Tom.
    Microsoft Access MVP

    >Below is a sample code that processes an Email using Microsoft Outlook in the background. From this code I've done the following:
    a.. The database it is incorporated into is a MSAccess '97 multi-user secured database that is used in a Citrix Environment
    b.. I've incorporated this code into a Module.
    a.. From the Menu in the Design view of this module, I select --Tools --References --"Microsoft Outlook 8.0 Object Library"
    c.. From the command button on one of my Forms, it processes a macro using "Runcode" TestMail ().
    d.. When I test the code using the command button it works for me
    e.. I've given the other users permission to the module where the code is stored but the code only works for me and not the other users
    a.. NOTE: prior to me using this "Runcode", I used the macro "SendMail" and it works for all the users
    >The problem is when the other users try using this same command button that processes this module by using the macro "Runcode" - testmail(), it gives the following run-time error message: "Run-time error '-2147287035 (80030005)': You don't have appropriate permission to perform this operation." HELP!!!!!!!!
    >
    >
    >P.S. When you post to your newsgroup, please also reply to this email address as well: johnny.outing-jr@boeing.ksc.n asa.gov
    >
    >Thanks
    >
    >
    >--------------------------------------------------------------------------------
    >
    >'============= =============== =============== ===============
    >
    >Public Sub TestMail()
    >
    Dim appOutLook As Object
    >
    Dim MailOutLook As Object
    >
    Dim strMSG As String
    >
    >
    >
    Set appOutLook = CreateObject("O utlook.Applicat ion")
    >
    Set MailOutLook = appOutLook.Crea teItem(olMailIt em)
    >
    strMSG = "How are you, my friend!"
    >
    With MailOutLook
    >
    .To = mailbox@domain
    >
    .Subject = "hello"
    >
    .Body = strMSG
    >
    .Send
    >
    End With
    >
    Set appOutLook = Nothing
    >
    >End Sub
    >
    >'============= =============== =============== =============== ==
    >
    >
    >
    >
    >
  • JOHNNY OUTING

    #2
    Re: MSAccess Runtime Error

    I implemented the code as you requested but it still gives a runtime error
    for the other users. It works for me but not the other users.

    --
    JOHNNY OUTING
    "Tom van Stiphout" <tom7744.no.spa m@cox.netwrote in message
    news:88djg4d0fv fa27jnf3h6atcvd tmr834b02@4ax.c om...
    On Thu, 30 Oct 2008 11:04:44 GMT, "JOHNNY OUTING" <outingjr@att.n et>
    wrote:
    >
    You managed to violate several netiquette rules in one post. Please
    review http://www.mvps.org/access/netiquette.htm
    This is a text-only newsgroup (you could have captured the error
    message with Ctrl+C), and if you can't be bothered to check back for
    messages, why would we make the effort to answer in the first place?
    >
    RunCode is designed to call a public FUNCTION, not a sub.
    >
    Also make sure you check the results of CreateObject; don't assume it
    works:
    if appOutlook is nothing then
    Msgbox "Aarrrrcchh h, Outlook not installed?"
    else
    Set MailOutlook... etc.
    end if
    >
    .To takes a string, like "mailbox@domain "
    >
    -Tom.
    Microsoft Access MVP
    >
    >
    >>Below is a sample code that processes an Email using Microsoft Outlook in
    >>the background. From this code I've done the following:
    > a.. The database it is incorporated into is a MSAccess '97 multi-user
    >secured database that is used in a Citrix Environment
    > b.. I've incorporated this code into a Module.
    > a.. From the Menu in the Design view of this module, I select -->
    >Tools --References --"Microsoft Outlook 8.0 Object Library"
    > c.. From the command button on one of my Forms, it processes a macro
    >using "Runcode" TestMail ().
    > d.. When I test the code using the command button it works for me
    > e.. I've given the other users permission to the module where the code
    >is stored but the code only works for me and not the other users
    > a.. NOTE: prior to me using this "Runcode", I used the macro
    >"SendMail" and it works for all the users
    >>The problem is when the other users try using this same command button
    >>that processes this module by using the macro "Runcode" - testmail(), it
    >>gives the following run-time error message: "Run-time error '-2147287035
    >>(80030005)' : You don't have appropriate permission to perform this
    >>operation." HELP!!!!!!!!
    >>
    >>
    >>P.S. When you post to your newsgroup, please also reply to this email
    >>address as well: johnny.outing-jr@boeing.ksc.n asa.gov
    >>
    >>Thanks
    >>
    >>
    >>--------------------------------------------------------------------------------
    >>
    >>'============ =============== =============== =============== =
    >>
    >>Public Sub TestMail()
    >>
    > Dim appOutLook As Object
    >>
    > Dim MailOutLook As Object
    >>
    > Dim strMSG As String
    >>
    >>
    >>
    > Set appOutLook = CreateObject("O utlook.Applicat ion")
    >>
    > Set MailOutLook = appOutLook.Crea teItem(olMailIt em)
    >>
    > strMSG = "How are you, my friend!"
    >>
    > With MailOutLook
    >>
    > .To = mailbox@domain
    >>
    > .Subject = "hello"
    >>
    > .Body = strMSG
    >>
    > .Send
    >>
    > End With
    >>
    > Set appOutLook = Nothing
    >>
    >>End Sub
    >>
    >>'============ =============== =============== =============== ===
    >>
    >>
    >>
    >>
    >>

    Comment

    • Tom van Stiphout

      #3
      Re: MSAccess Runtime Error

      On Thu, 30 Oct 2008 18:00:10 GMT, "JOHNNY OUTING" <outingjr@att.n et>
      wrote:

      I have no other suggestions, but I noticed your email address has the
      nasa.gov domain, which in my imagination means a more-than-average
      secured environment, so perhaps the error message is true: the user
      does not have programmatic rights to perform this operation.

      Btw another besides-the-point observation: if you set a reference to
      Outlook, you are using "early binding", whereas your code snippet uses
      "late binding" which does not make sense.

      -Tom.
      Microsoft Access MVP

      >I implemented the code as you requested but it still gives a runtime error
      >for the other users. It works for me but not the other users.

      Comment

      • JOHNNY OUTING

        #4
        Re: MSAccess Runtime Error

        Thanks for sharing your expertise!

        --
        JOHNNY OUTING
        "Tom van Stiphout" <tom7744.no.spa m@cox.netwrote in message
        news:sh6lg4t5mt 8nddaf4e80lq6ft m62a5l3j9@4ax.c om...
        On Thu, 30 Oct 2008 18:00:10 GMT, "JOHNNY OUTING" <outingjr@att.n et>
        wrote:
        >
        I have no other suggestions, but I noticed your email address has the
        nasa.gov domain, which in my imagination means a more-than-average
        secured environment, so perhaps the error message is true: the user
        does not have programmatic rights to perform this operation.
        >
        Btw another besides-the-point observation: if you set a reference to
        Outlook, you are using "early binding", whereas your code snippet uses
        "late binding" which does not make sense.
        >
        -Tom.
        Microsoft Access MVP
        >
        >
        >>I implemented the code as you requested but it still gives a runtime error
        >>for the other users. It works for me but not the other users.

        Comment

        Working...