ACC2000: Modifying Linked Exchange Tables in Microsoft Access

ID: Q207771


The information in this article applies to:
  • Microsoft Access 2000

Moderate: Requires basic macro, coding, and interoperability skills.


SUMMARY

When you create a table in Microsoft Access 2000 that is linked to either a Microsoft Exchange folder or a Microsoft Outlook folder, there are system-imposed limits on what you can add, change, or delete. This article discusses those restrictions.

You can download Microsoft Access wizards that make it easier for you to link or import Exchange and Outlook folders. The Exchange and Outlook wizards are available, free of charge, from Microsoft's World Wide Web site at:

http://www.microsoft.com/accessdev/a-free.htm
NOTE: The information in this article applies to linked tables only. If you import a Microsoft Exchange/Outlook table into your database, the limitations described in this article do not apply.


MORE INFORMATION

Linked Microsoft Exchange and Outlook data is best suited as a read-only reference or as lookup information in your database. For example, you can use the Global Address Book to look up e-mail names for message recipients, or you can use Calendar information to view existing appointments and identify schedule conflicts.

However, if you want to modify data in the linked table, the following sections discuss some of the limitations you may encounter.

Adding New Records

When you link an Exchange or an Outlook folder within your database, you have no choice of which fields to display in the table. The subset of fields that appear in your table are preprogrammed in the Microsoft Messaging driver (Msexch35.dll) that manages the connection between Microsoft Access and Exchange or Outlook.

When you add a new record to the table, some fields produce the following error message when you try to enter data:
Field FieldName is based on an expression and can't be edited.
You cannot update these fields in Microsoft Access; however, after you identify the fields, you can simplify your data entry by hiding those columns as follows:
  1. Open the linked table in Datasheet view.


  2. Place the insertion point in a column that does not allow updating.


  3. On the Format menu, click Hide Columns. Note that the column is no longer visible.


  4. Repeat steps 2 and 3 for each column that you want to hide.


To display the columns again:
  1. Open the linked table in Datasheet view.


  2. On the Format menu, click Unhide Columns.


  3. In the Unhide Columns dialog box, click to select the check box for those columns that you want to display again.

    NOTE: You can also click to clear the check box for any columns that you want to hide.


  4. Click Close.


Also, if you want Microsoft Outlook to use a specific form to display your new record, you must enter the correct data in the Message Class field. The Message Classes for the standard Microsoft Outlook folders are:

      FOLDER      MESSAGE CLASS
      ---------   -------------
      Calendar    IPM.Appointment
      Contacts    IPM.Contact
      Inbox       IPM.Note
      Journal     IPM.Activity
      Tasks       IPM.Task 

Modifying Records

You cannot modify any records in a linked Microsoft Exchange or Outlook table. The Microsoft Messaging driver is designed only for reading existing records and adding new ones.

Deleting Records

When you delete a record from a linked Microsoft Exchange or Outlook table, the record is immediately and permanently deleted. You cannot use the Undo command to restore the record, and the record does not appear in the Deleted Items folder in Microsoft Exchange or Outlook.

Use caution and be sure that you really want to delete a selected record before you proceed.

You can work around this behavior in several ways:
  • If you are using Microsoft Access security in your database, you can set permissions for the linked table so that deleting records is not allowed. This safeguards against accidental deletion of a record at the table level.


  • If you are using a form based on a linked Microsoft Exchange or Outlook table, you can set the form's AllowDeletions property to False. This prevents anyone who uses the form from accidentally deleting a record; however, you can still delete records directly from the table or a query.


  • If you are using a form based on the linked table and you want to allow users to delete records, you can set the OnDelete property of the form to a macro or event procedure that prompts a user to confirm the deletion. For example, you could use the following code.


  • Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Solution Provider or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Solution Providers, please see the following page on the World Wide Web:

    http://www.microsoft.com/mcsp/
    For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

    http://www.microsoft.com/support/supportnet/overview/overview.asp
    
    Private Sub Form_Delete(Cancel As Integer)
        'Display a custom dialog box to confirm deletion.
        If MsgBox ("Are you sure you want to delete this record?", _
            vbOKCancel) = vbCancel Then
            Cancel = True
        End If
    End Sub 

Additional query words: attach update

Keywords : kbinterop kbdta IsmOthr
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbinfo


Last Reviewed: January 3, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.