Results 1 to 2 of 2
  1. #1
    StarOn9 is offline Novice
    Windows 10 Access 2019
    Join Date
    May 2023
    Posts
    1

    Adding your own DLL causes problems with Access standard functions

    Hello,



    I'm trying to use functions via a self-written DLL with Interop COM at Access 2021 64-bit.

    The DLL works and is registered with regasm.exe /codebase. However, as soon as I add this DLL at the references (just adding without using the functions at all), the Access Format function no longer works as a side effect. She only gives #Name! as a result. If I remove the reference it works again. I have checked all references and none are missing.

    The DLL consists only of a class called MyTest and a function called Test. If I try to use the function Test it works. Only the standard Format function in Access no longer works in all places in the database as soon I add the reference.

    Code:
    namespace Test
    {
    
        [ComVisible(true)] 
        [Guid("1D47E5B9-416D-450E-B0BD-27348B4703BA")]
        [InterfaceType(ComInterfaceType.InterfaceIsDual)]
        public interface ITest
        {
            string Test();
        }
    
        [ComVisible(true)] 
        [Guid("E9DB2D69-6054-47A0-AD9D-28B263432303")]
        [ClassInterface(ClassInterfaceType.None)]
        [ProgId("Test.MyTest")]
        public class MyTest : ITest
        {
            public MyTest()
            {
            }
    
            public string Test()
            {
                string returnValue = "Test";
    
                return returnValue;
            }
        }
    }
    I can't explain why this could be and I just can't find a solution.
    I would be grateful for any tip or help.

    Thanks a lot,
    Andreas

  2. #2
    Qulitima is offline Novice
    Windows 10 Access 2019
    Join Date
    Jun 2023
    Posts
    1
    The issue you're experiencing with the Format function in Access not working after adding a reference to your self-written DLL might be related to a conflict between the DLL and Access's internal libraries. When you add a reference to an external DLL, it can sometimes interfere with the existing functionality of Access.Here are a few suggestions you can try to resolve the issue:Check for naming conflicts: Ensure that your DLL does not have any conflicting names with Access's internal functions or objects. The name "Test" you used for your class and function is generic, so it's unlikely to cause conflicts, but it's worth checking.Use a unique namespace: Make sure the namespace you're using for your DLL is unique and does not clash with any existing namespaces in Access or other referenced libraries.Register the DLL as a COM server: Instead of using regasm.exe, try registering the DLL as a COM server using the regsvr32 command. Open a command prompt as an administrator and run the following command: regsvr32 "path\to\your\DLL.dll"This will register the DLL with the operating system, which may provide better integration with Access.Verify dependencies: Ensure that your DLL and any dependencies it relies on (such as external libraries) are present and accessible. If any required dependencies are missing or not registered properly, it could cause issues with Access.Check for error messages: Look for any error messages or warnings in the Access application or event logs that might provide more information about the issue. This could help pinpoint the specific problem.Test on a different machine: Try running your Access database on a different machine to see if the issue persists. This can help determine if the problem is specific to your environment or if it's a more general compatibility issue.If none of these suggestions resolve the problem, it may be necessary to debug the issue further by examining any error messages or logs, as well as analyzing the code and dependencies of your DLL more thoroughly. Alternatively, you have the option to consult with experts who have expertise in the field of personalized software development <link removed by moderator>
    Last edited by pbaldy; 06-22-2023 at 07:07 AM.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. More problems with functions not found
    By GraeagleBill in forum Programming
    Replies: 14
    Last Post: 03-01-2022, 11:04 AM
  2. Adding standard values in query / chart
    By dcf1999 in forum Queries
    Replies: 6
    Last Post: 12-09-2019, 02:58 PM
  3. Replies: 6
    Last Post: 05-26-2015, 04:11 AM
  4. Problems adding a new entry
    By octsim in forum Programming
    Replies: 1
    Last Post: 10-24-2013, 07:35 AM
  5. Replies: 18
    Last Post: 11-09-2010, 02:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums