Run Time Error 13

B

B

Function DisableByPassKeyProperty()
Dim DB As Database
Dim prp As Property

Set DB = OpenDatabase("testing.mdb")
Set prp = DB.CreateProperty("AllowByPassKey", dbBoolean, False)
DB.Properties.Append prp
 
D

Douglas J. Steele

The Property object exists in many different object models. Since you're
using DAO, it's essential that you get a DAO Property.

Replace

Dim prp As Property

with

Dim prp As DAO.Property

There would be nothing wrong with using Dim DB As DAO.Database, but since
(at present) no other object model than DAO has a Database object in it, you
can probably get away without the specification (FWIW, I always use
DAO.Database)
 

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