Microsoft KB Archive/303829

= ACC97: Error Message: &quot;Compile Error: Function or Interface Marked as Restricted, or the Function Uses an Automation Type Not Supported in Visual Basic&quot; =

Article ID: 303829

Article Last Modified on 1/31/2007

-

APPLIES TO


 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q303829



Moderate: Requires basic macro, coding, and interoperability skills.



SYMPTOMS
When you try to open an Access database after you install Microsoft Windows 2000, you may receive the following error message:

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

In the Microsoft Visual Basic for Applications references, the Data Access Object (DAO) 3.60 Object Library is selected and the DAO 3.51 Object Library is not in the list of available references.

If you run the Me.RecordsetClone.FindFirst method, you may receive the same error message.



CAUSE
This behavior can occur if the reference to DAO 3.51 is missing or if Access 97 does not recognize DAO 3.51.

Access 97 does not recognize DAO 3.51 because during Windows 2000 installation, the Windows registry registers DAO 3.60 and updates the reference in Access 97 to DAO 3.60. Windows also removes the registration for DAO 3.51.



RESOLUTION
To resolve this behavior, follow the appropriate set of steps.
 * If you receive the error message when you try to open an Access 97 database after you install Windows 2000, you need to both register the Dao350.dll file and specify the correct Object Library reference.
 * If you receive the error message when you run the Me.RecordsetClone.FindFirst method, you only need to specify the correct Object Library reference.

If You Receive the Error Message After You Install Windows 2000
To manually register the Dao350.dll file and then specify the DAO 3.51 Object Library, follow these steps:  Click Start, and then click Run. In the Open box, type the following command

Regsvr32.exe &quot; \Dao350.dll&quot;

where  is the path to the Dao350.dll file, and then click OK.

 Open the database in which you are experiencing the behavior, and then open a new or existing module in Design view. On the Tools menu, click References. In the Available References box, click to clear the Microsoft DAO 3.6 Object Library check box, and then click to select the Microsoft DAO 3.51 Object Library check box. Click OK.</ol>

If You Receive the Error Message After You Run Me.RecordsetClone.FindFirst
To specify the DAO 3.51 Object Library, follow these steps:
 * 1) In Access 97, open a new or existing module in Design view.
 * 2) On the Tools menu, click References.
 * 3) In the Available References box, click to clear the Microsoft Visual Basic for Applications Extensibility 5.3 check box, and then click to select the Microsoft DAO 3.51 Object Library check box.
 * 4) Make sure that the selected references are in the following order: Visual Basic for Applications, Microsoft Access 8.0 Object Library, and Microsoft DAO 3.51 Object Library.
 * 5) Click OK.

Additional query words: prb

Keywords: kbenv kbinterop kbprb KB303829

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.