ActiveX Data Objects collection Fields is missing Update method RRS feed

  • Question

  • I'm trying to modify an Access database so that the e-mail functionality in one of its forms is able to send an email directly to our SMTP server without opening an Outlook window. Seems like it should be easy enough; as with most such things, it's proven to be anything but.

    Currently, I'm trying to use COM functionality contained in CDO for Windows 2000 (CDO 2.0).    I have a reference for that in my email subprocedure, along with a reference for ActiveX Data Objects 2.1 Library.  My understanding, from reading sample code in MSDN Library - Visual Studio 2008, is that I need to create a CDO Configuration object to specify such things as the smtp server and the authentication for same.  The code samples demonstrate declaring an object/collection variable of type ADODB.Fields and assigning to that variable the fields collection returned by the Configuration.Fields property (where Configuration is an object of type CDO.Configuration).  However, when I run my form, I get a Compile error: Method or data member not found, that seems to be referring to the .Update method.  This makes sense, in that "Update" does not appear in the list of available members that pop-up courtesy of Intellisense in the VBA editor (see below).  But, my question is, why? 

    Tuesday, July 10, 2018 5:47 PM

All replies

  • Hi Tim,

    Just curious... Could you give this demo a quick try just to see if you get the same problem or not?


    Tuesday, July 10, 2018 7:31 PM
  • There are too many potential constraint issues with modifying the attributes of an existing field, especially when it either contains data (which could result in a type mismatch) or refers to a corresponding column in a database. In this instance you can only add new fields (Append) to the collection or delete fields (Delete) from the collection.

    Paul ~~~~ Microsoft MVP (Visual Basic 1994-2018)

    Wednesday, July 11, 2018 1:28 PM