Solved

Send Email Transactions to a SQL Server Database

Posted on 2006-06-23
3
240 Views
Last Modified: 2010-04-08
Objective
-----------

Develop a MS Outlook VBA project that will send email transactions(ie. Mail received, mail deleted, mail opened, etc.) to a SQL*Server database.  For example, when a user opens an email I need to send a record, ie. transaction, to the database recording such event.  Also, I want to send the email's subject, from address, to address, # of attachments, etc. as a part of the record into the SQL*Server database.

Questions
------------
1.  Is it possible to connect to a SQL*Server database using MS Outlook Macro/VBA, and automate such event when the transaction occurrs?  If so, is there a technical document illustrating such?
2.  Do email messages have a unique identifier that can be tracked?

Thanks!
0
Comment
Question by:dkbailey1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 16972164
Greetings, dkbailey1.

> Is it possible to connect to a SQL*Server database using MS Outlook Macro/VBA
Yes, using ADO.

> and automate such event when the transaction occurrs
For the events you listed, yes.

> is there a technical document illustrating such
I don't think there's any specific technical documentaation for accessing SQL server from inside Outlook.  There doesn't need to be.  You can access SQL server via ADO from pretty much anything.  The ADO documentation has what you need, it won't care that it's running from inside Outlook.  There is technical documentation for Outlook's event model.  There are books on the subject, information on the MSDN web site, and both OutlookCode.com (especially good) and Slipstick.com have information about the events available in the Outlook object model.

> Do email messages have a unique identifier that can be tracked?
Not really.  Each item in Outlook has a property called EntryID that is unique within a message store (i.e a given PST file or online mailbox).  If an item is moved from one store to another, then its EntryID changes.  If having a unique identifier is necessary, then you'll need to create it.  Outlook objects do support user created properties, so this is actually pretty easy to do.

Cheers!
0
 

Author Comment

by:dkbailey1
ID: 16983793
So I can process ADO recordsets from an Outlook VBA module in the same way that I could from MS Access?  I need to be able to Delete, Insert, and Update records in the SQL*Server database from the Outlook module.  Sounds like I can, please confirm.  Thanks.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 16987528
Yes, you can.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this step by step procedure, you will come to know the details of creating an Outlook meeting in 2007, 2010, 2013 & 2016.
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question