Microsoft KB Archive/167660

= ACC97: Modifying Linked Exchange Tables in Microsoft Access =

Article ID: 167660

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q167660



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



SUMMARY
When you create a table in Microsoft Access 97 that is linked to a Microsoft Exchange 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 Microsoft Exchange folders. The Exchange/Outlook wizards are available, free of charge, from Microsoft's World Wide Web site at:

http://www.microsoft.com/accessdev/a-free.htm

For information about installing the Exchange/Outlook driver without using a wizard, please see the following article in the Microsoft Knowledge Base:

159322 ACC97: Paradox, Lotus, & MS Exchange/Outlook ISAMs in ValuPack

NOTE: The information in this article applies to linked tables only. If you import a Microsoft Exchange table into your database, the limitations described in this article do not apply.



MORE INFORMATION
Linked Microsoft Exchange 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 will encounter.

Adding New Records
When you link a Microsoft Exchange folder in your database, you have no choice of which fields to display in the table. The subset of fields that appear in your table are pre-programmed in the Microsoft Messaging Driver, Msexch35.dll, which manages the connection between Microsoft Access and Microsoft Exchange.

When you add a new record to the table, some fields produce the following error message when you try to enter data:

Field '' is based on an expression and can't be edited.

You cannot update these fields in Microsoft Access; however, once 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 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 you want to display again.

NOTE: You can also click to clear the check box for any columns you want to hide.
 * 1) 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 Notes       IPM.StickyNote Tasks       IPM.Task

Modifying Records
You cannot modify any records in a linked Microsoft Exchange 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 table, the record is immediately and permanently deleted. You cannot use the Undo command to restore the record, and it does not appear in the Deleted Items folder in Microsoft Exchange.

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

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 the linked Microsoft Exchange table, you can set the form's AllowDeletions property to False. This will prevent anyone from accidentally deleting a record using the form; 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:

NOTE: This example assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to the "Building Applications with Microsoft Access 97" manual.

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: kbinfo kbinterop KB167660

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.