none
Dotnet DLL not Working in Access RRS feed

  • Question

  • I have created a Dotnet DLL and registered on my windows computer. I reference the same DLL on my Access database. It was working good few months back. when I make the additional changes to the DLL then it Stopped working. it gives me error "Object variable or block variable not set" then when I add the " [ClassInterface(ClassInterfaceType.None)]" code in dotnet class then error message showing as "method or data member not found".
    Thursday, September 26, 2019 4:38 PM

All replies

  • Well, some of your changes broke COM+. So you need to compare the working source with the broken one.

    Setting ClassInterfaceType.None means that you can only use the methodes of the interface the class is implementing explicitly.

    So the questions are: Do you implememnt an interface in this class and do you implement this interface explicitly?

    Sunday, September 29, 2019 1:11 PM
  • If you did not build your own interface?

    Well, then if you change (or use) <ClassInterface(ClassInterfaceType.None)>

    Then, you have to use late binding. (and setting a reference in VBA is not required).

    If  you use <ClassInterface(ClassInterfaceType.AutoDual)>, then you can use early binding, and you will get intel-sense.

    So  in place of writing an interface, just use private to hide variables, subs, functions, properties.

    I also tend to find if you by accident expose a non valid data type (like some .net collection, ilist), then the resulting object tends to break, or not work.

    I do suggest you thus don't mark anything as public. (this is a good reason as to why building your own interface is a good idea). However, I have for years just used autoDual. 

    In your case, I would suggest switching (trying) late binding, since that is a requirement if you interface type is set to none, and you are NOT building your own custom interface.

    Regards,

    Albert D. Kallal (Access MVP 2003-2017)

    Edmonton, Alberta Canada


    Tuesday, October 1, 2019 1:47 AM