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)
 
Top