Microsoft KB Archive/103136

From BetaArchive Wiki

PRA: Open OLE Objects Not Saved When Record Changes (2.0)

Article ID: Q103136
Creation Date: 18-AUG-1993
Revision Date: 19-SEP-1996 The information in this article applies to:

  • Microsoft Access versions 1.0, 1.1, 2.0

SYMPTOMS


Advanced: Requires expert coding, interoperability, and multiuser skills.

If you are editing an OLE object that is opened from an OLE field, and you then move to a different record, there is no indication that the record was changed. The OLE object in the OLE server is closed and all changes to the object are lost.

RESOLUTION


In Version 1.0


One way to work around this problem in Microsoft Access version 1.0 is to call an Access Basic function in the OnExit property of the object. The function prompts you to verify that the object has been updated. The following is an example of this function:

Place the function called =ProcessOLEObject() in the OnExit property of the OLE object. Create the following module:

      Function ProcessOLEObject ()
         Saved = MsgBox("Have you saved your changes for this object?", 36)
         If Saved = 7 Then
            DoCmd CancelEvent
            DoCmd DoMenuItem A_FormBar, A_EditMenu, A_Object,

A_ObjectUpdate

         End If
      End Function

Every time you pass through the OLE field, the function will be run and the dialog box will be displayed. Unfortunately, there is no way to test whether or not the object has been edited. In Versions 1.1 and 2.0


In Microsoft Access versions 1.1 and 2.0, a dialog box appears, indicating that the object is editable and gives you the option to update the object before moving on to the next record.

For example, the following message appears after you open one of the pictures in the Employees table in the sample database NWIND.MDB:

   The object "Paintbrush Picture" is open for editing and may have
   been modified. Update before saving? Yes, No, Cancel or Help

MORE INFORMATION

Steps to Reproduce Problem


  1. Open the sample database NWIND.MDB in Microsoft Access version 1.0.
  2. Open the Employees form.
  3. Double-click the image that you want to edit. This action will start Paintbrush.
  4. Make some change to the image.
  5. Press ALT+TAB to return to Microsoft Access without saving the image.
  6. Move to the next record. Note that if you press CTRL+ESC to view the

task

   list, Paintbrush is no longer available. If you go back to the record

you

   were editing, the picture will not contain the changes you made.



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

©1997 Microsoft Corporation. All rights reserved. Legal Notices.


Additional reference words: 1.00 1.10 2.00 photo
KBCategory: kbole
KBSubcategory: IntpOle