"Compile Error: Function or Interface Marked as Restricted..."

M

MM

I've just converted an Access 2.0 app to Access 2000 format using Access
2002. When I try to compile, I get the following error message:

"Compile Error: Function or Interface Marked as Restricted, or the Function
Uses an Automation Type Not Supported in Visual Basic"

The error message occurs here:

MyDB.BeginTrans

I found a similar problem that was addressed in the Knowledge Base (article
303829), but that applies to Access 97. I'm running Windows XP
Professional/Access 2002.

Any thoughts?

Thanks.
 
P

peter walker

The object model for DAO in Access 2002 is different from versions 2.x.
The BeginTrans member is restricted (read unavailable) for the Database
class in later version of DAO.

You will need to study the object model and modify your code to use the
workspace object.
The transaction stuff is a member of the Workspace class now not Database.

As a temporary measure...
You may however use (set a reference) the ...
Microsoft DAO 2.5/3.51 Compatibility Library
(C:\Program Files\Common Files\Microsoft Shared\DAO\dao2535.tlb)

This library has BeginTrans as a hidden member of the Database class and
over-all your code should run.

I strongly recommend you port the code to the later versions of DAO.
You will find more than the transaction members have changed or been
removed.

hth
peter walker
 
M

MM

Peter, thanks very much for the explanation. I couldn't find an answer
anywhere else. Your advice to make the code compatible with the latest DAO
is sound, and I'll certainly take it. Thanks again.

Margaret
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top