Results 1 to 10 of 10
  1. #1
    Join Date
    May 2012
    Posts
    89

    Unanswered: Query in a mail body

    Hi i have a query called "qryRAPPORTAGEverzend" and i want to sent its contents in a mail body.
    But i dont know where to start.
    Can anyone help me plz....

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Start by Googling "SQL Injection" ???

    This isn't difficult to do (at least in most cases), but it is pretty dangerous. It leaves your database almost wide open to any would-be attacker.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    May 2012
    Posts
    89
    I dit a Google, but i cant be happy about the result.
    Is there a way to do this saver?

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Without knowing exactly what you want to do, I can't answer that question.

    If you allow the contents of email messages to be processed as queries, that allows anyone that can send an email to the "watched" address to do whatever the connection running the query has permission to do...

    You could create a drastically limited log in with only a few very specific permissions, but I'd be uncomfortable doing even that. If there was any type of "human error" that allowed greater priviliges for that account, those priviliges would pass to everyone using the email system.

    I'm sure that I'm just an old worry wart, but I can't imagine ever doing or even allowing a client to do something like this.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  5. #5
    Join Date
    May 2012
    Posts
    89
    Well to explane about what i want to do:
    If got an query of records of two days but the first record must start on 07:00> and end on the next day on 07:00<

    Also im not an admin on the computer and dont want to take any troubling actions.

    But i dont know the trouble it could couse... and take in mind the query isn't that complicated and will only generate certain records.
    The query is just opent by klikking a button and selecting a date.

    But maybe im missing your point.

  6. #6
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    take a look at the help file for sendobject

    If you want something more complex you can look into outlook automation if you're using outlook for email.

  7. #7
    Join Date
    May 2012
    Posts
    89
    Yes im using the sent object wright now.

    But the thing is... the users, before i made this copied the records from the datasheet forms and paste it in a mail.

    This is how the managers want to have the result.
    That is a mail with the data in the mail instead of the data in a object that has been added to the mail.

    But the users want to sent the data but without the copy/paste action.

    As sad before i don't want to compromise any security on the computer systems...

    And with this you see my point...

  8. #8
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I think that I mis-interpreted your question. I originally thought that you wanted to email a query to be extracted from the message and run, then have the results of that query returned via email... After re-reading this thread, it appears that you want to run a static query via a commandButton and put the results of that query into the body of an email that is sent to the user for the user to read and then process. Is my new understanding correct?

    If my understanding of what you want is correct, then just put the content you want to send into the .messageText attribute of the SendObject and things ought to be fine.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  9. #9
    Join Date
    May 2012
    Posts
    89
    That is exactly what i want but im having trouble finding the code, i know how to put in info from a certain record or a form but not from a query or table.
    + how do i make it a DSview.
    Hope you can help me get on the wright way....

    The DSview of the query is called: "frmTABELrapportageVERZEND" and the 3 textboxxes are called "Tijd" and "Datum" and "Memo"

    And how can i sent this certain mail to more poeple at the same time????

  10. #10
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Uff-da... I don't work with MS-Access enough to help you with this. I'd use the GetXML method to extract the data from the DSView, then parse that XML to build the message body if I were doing this task. Maybe one of the MS-Access gurus has a better option for you.

    To send to multiple email addresses, just put them all into the address attribute (To, CC, or BCC) and separate the email addresses by semi-colons.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •