Advertisement

04.16.2008 at 07:57AM PDT, ID: 23327359
[x]
Attachment Details

Storing fields of current message (i.e. To, From, CC) in variables.

Asked by NO_CARRIER in Outlook Groupware Software, Microsoft Access Database, SQL Query Syntax

Tags: microsoft, outlook, 2003

Hi, I created a custom form for outlook, with additional fields.
When the user sends a message with this form, I would like to send various fields (including the custom fields) to an Access Database.

I already created the database, and my connection is working properly.  I am able to insert data into the table.

However, I would like to store the fields as strings before creating my SQL string to send to the database.

From the current message, as the user clicks send I would like to store:

To
CC
Subject
plus my custom fields
ClientName
AccountNumber
etc.

how would I do this?

Attached is the SQL connection I'm using...Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
Sub ExportToADO()
    Dim adoCon As ADODB.Connection, _
        adoRS As ADODB.Recordset, _
        strSQL As String, _
        SAccountNumber As String, _
        SClientName As String, _
        SIAName As String, _
        SBMName As String, _
        SSendDate As String, _
        SStatus As String
    
    SSendDate = "#" & Format(Date, "yyyy-mm-dd") & "#"
    
    Set adoCon = CreateObject("ADODB.Connection")
 
    adoCon.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
                  "DBQ=NewAccounts_Rejects.mdb;" & _
                  "DefaultDir=H:\"
  
            strSQL = "INSERT INTO Main (AccountNumber,ClientName,TOName,CCName,SendDate,Status) " _
            & "VALUES(Test1,Test2,Test3,Test4," & SSendDate & ",'REJECTED')"
 
            Set adoRS = adoCon.Execute(strSQL)
   
    Set adoRS = Nothing
    adoCon.Close
    Set adoCon = Nothing
    MsgBox "All Done!"
End Sub
[+][-]04.16.2008 at 12:53PM PDT, ID: 21371361

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.16.2008 at 01:16PM PDT, ID: 21371572

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.16.2008 at 01:20PM PDT, ID: 21371606

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.16.2008 at 01:21PM PDT, ID: 21371613

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.17.2008 at 11:02AM PDT, ID: 21379663

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.17.2008 at 04:17PM PDT, ID: 21382245

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Outlook Groupware Software, Microsoft Access Database, SQL Query Syntax
Tags: microsoft, outlook, 2003
Sign Up Now!
Solution Provided By: NO_CARRIER
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628