Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

BUG: Access object model breaks binary compatibility


View products that this article applies to.

Symptoms

Automation clients written for Microsoft Access 97 that use either early binding (VB, ATL with #import) or dispid binding (MFC) might unexpectedly fail when trying to automate Microsoft Access 2000, Microsoft Access 2002, Microsoft Office Access 2003, or Microsoft Office Access 2007.

Among the possible errors you might receive as a result of this problem are as follows:
0x80020003 : 438 - Object doesn't support this property or method.
0x80020004 : 448 - Named argument or parameter not found.
0x80020005 : 13 - Type mismatch.
Many functions might also produce custom errors from Access or might not return an error at all; that is, the call appears to have succeeded but the correct method was not called.

↑ Back to the top


Cause

During development of Access 2000, the Access object model was accidentally modified in a way that breaks both binary (v-table) and dispid compatibility with Access 97. Any client application that uses early or dispid binding to Access 97 might fail to work properly when run against Access 2000, Access 2002, Access 2003, and Access 2007.

The following non-compatible changes were made to the Access object model:
  • Both the Report and Form objects have new properties and/or methods inserted in the middle of their respective interfaces. This means that the binary layout of each object's v-table have been changed, while the interface identifiers (IIDs) were left unchanged. This is a violation of the rules of COM and has resulted in a binary incompatibility with previous versions of Access.

    Clients using early binding to the Access 97 type library can expect calls made to these objects to fail in Access 2000, Access 2002, Access 2003, and Access 2007 because the methods they intend to call have been mistakenly moved in newer versions of Access.
  • A number of properties and methods in the Access Object Model have had their dispatch identifiers (dispids) changed. As a result, any Automation client that stores dispids from the Access 97 type library and uses them in Access 2000 might receive errors when calling these methods.

    NOTE: MFC programmers are the most likely to see this problem. While you can use the Class Wizard-generated wrapper classes to automate a particular version of Access, they do not work for all versions.
  • All of the following controls have been changed to inherit from IAccessible instead of IDispatch:
      BoundObjectFrame     CustomControl        OptionGroup
      CheckBox             Label                TabControl
      ComboBox             ListBox              TextBox
      CommandButton        OptionButton         ToggleButton
    						
    This change resulted in additional methods being added to the beginning of the v-table for these objects. As noted above, clients using early binding to the Access 97 type library might accidentally call the wrong methods or properties when communicating with these objects in newer versions of Access.

↑ Back to the top


Resolution

Automation clients that want to Automate Access 97, Access 2000, Access 2002, Access 2003, and Access 2007 "must" use late binding (that is, IDispatch::GetIdsOfNames and IDispatch::Invoke).

↑ Back to the top


Status

Microsoft has confirmed this to be a bug in Access 2000.

However, due to the number of clients currently using early binding to Access 2000, this problem cannot be fixed without risking further incompatibilities. Access 2002, Access 2003, and Access 2007 remain compatible with Access 2000, but not Access 97.

Microsoft recommends that out-of-process clients use late binding to automate Access.

↑ Back to the top


References

For more information about Automation binding methods, click the following article number to view the article in the Microsoft Knowledge Base:
245115 Using early binding and late binding in Automation

↑ Back to the top


Keywords: KB246237, kbnofix, kbbug, kbautomation

↑ Back to the top

Article Info
Article ID : 246237
Revision : 10
Created on : 5/11/2007
Published on : 5/11/2007
Exists online : False
Views : 392