Solved

Send Email Transactions to a SQL Server Database

Posted on 2006-06-23
3
235 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Outlook Free & Paid Tools
Read this checklist to learn more about the 15 things you should never include in an email signature.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
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…

740 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