• Compile Error – broken references? (Access97)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Compile Error – broken references? (Access97)

    Author
    Topic
    #362528

    For some reason unknown, my Access97 has started to fail to run or compile programs that were operating without problem until just a couple of days ago. The error I receive is:

    Compile Error
    Function or interface marked as restricted or the function uses an
    Automation type not supported in Visual Basic.

    When I try to compile the code the error lines refer to objects like ‘currentdb’ or ‘dbengine’.
    I suspect this may be a case of broken references, but the list looks OK (…as a secondary question, how do I know what references should be set anyway?). The problem appears to be affecting all mdbs, and not just one which may have been corrupted. After trying a number of things, I have even tried a reinstall of A97, but still without success.

    I would be grateful for any help in interpretting this error, and even more so for suggestions about how to fix it.

    Thanks,
    Geoff

    Viewing 2 reply threads
    Author
    Replies
    • #550834

      Are you using any ActiveX controls or Office automation? The only thing I found in the knowledgebase is this BUG: Access 97 Generates Invalid Code for OLE_COLOR [Q205673] If you are using ActiveX controls, have you installed anything new on your machine that might have either stepped on the libraries or “updated” them so they no longer work?

    • #551267

      Have any of your Microsoft Office files been moved to different locations recently? We had a similar problem when we were upgraded to Office 2000 and Access97 was moved to a different directory to allow time for conversion efforts. The Access97 projects looked for references in Microsoft OfficeOffice and automatically changed them to the newer versions, so that the reference to Microsoft Access pointed to MSACC9.OLB instead of the required MSACC8.OLB (97 version). MSACC8.OLB is the Object Library that has interfaces that recognize the names ‘currentdb’ and ‘dbengine’ . We also were using Word Automation and since Word 97 had been removed, the reference was automatically changed to MSWORD9.OLB. I have also had the experience that sometimes just unchecking the reference even if it looks to be pointing to the right OLB or DLL location, closing the project, reopening it, and resetting the reference by checking it again fixes these broken references. You might have to reset all the references; when this happened to me I was also getting compile errors on VBA functions even though the VBA library appeared checked in the list. Even if none of your files have been moved, it might be worth a shot to redo references. Good luck!

    • #551419

      Thanks to all those who responded. Yes, I did find that reference, Charlotte, but it was not of much relevance in this case.

      It is ironic that the solution was exactly what I had commended to another poster in a previous reply (#63460). The problem turned out to be that once again DAO350.DLL had lost its registration and I had to re-register it. Now I just need to find out what is causing that to happen! I suspect some interference mechanism between A2K and A97, but have no thoughts yet on how to test or prove that, as it is very intermittent (I have seen it twice now, but with symptoms which were different enough to throw me off the scent).

      Geoff

    Viewing 2 reply threads
    Reply To: Compile Error – broken references? (Access97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: