ACC97: Error Message: "Compile Error: Function or Interface Marked as Restricted, or the Function Uses an Automation Type Not Supported in Visual Basic" (303829)
The information in this article applies to:
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 "Path\Dao350.dll"
where Path 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.
If You Receive the Error Message After You Run Me.RecordsetClone.FindFirst
To specify the DAO 3.51 Object Library, follow these steps:
- In Access 97, 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 Visual Basic for Applications Extensibility 5.3 check box, and then click to select the Microsoft DAO 3.51 Object Library check box.
- 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.
- Click OK.
Modification Type: | Major | Last Reviewed: | 9/27/2003 |
---|
Keywords: | kbenv kbinterop kbprb KB303829 |
---|
|