O
otterbyte
I have an Access 2003 database and I have the code to disable the
bypass key on startup set. I just moved to a new computer (and from
Win XP to Vista Business) and now the code breaks with Type Mismatch
on the "Set prp..." line:
*******************
Dim strDB As String
Dim db As DAO.Database
Dim prp As DAO.Property
strDB = InputBox("Enter Path for mde or mdb:", "Prep for
Distribution", _
"C:\MyDatabase.mde")
Set db = DBEngine.Workspaces(0).OpenDatabase(strDB)
With db .Properties.Delete "AllowByPassKey"
Set prp = .CreateProperty("AllowByPassKey", dbBoolean, False,
True)
.Properties.Append prp
End With
*********************
I've checked my references. Nothing is missing, I don't have ADO
checked, and the DAO reference is as high as it can go (just below the
VBA and Access 9.0 references, and above the OLE automation and VBA
extensibility references). I've properly (I think) disambiguated the
creation of the Property object, prp. The code compiles.
So am I missing something really obvious? I can't figure this one
out!
bypass key on startup set. I just moved to a new computer (and from
Win XP to Vista Business) and now the code breaks with Type Mismatch
on the "Set prp..." line:
*******************
Dim strDB As String
Dim db As DAO.Database
Dim prp As DAO.Property
strDB = InputBox("Enter Path for mde or mdb:", "Prep for
Distribution", _
"C:\MyDatabase.mde")
Set db = DBEngine.Workspaces(0).OpenDatabase(strDB)
With db .Properties.Delete "AllowByPassKey"
Set prp = .CreateProperty("AllowByPassKey", dbBoolean, False,
True)
.Properties.Append prp
End With
*********************
I've checked my references. Nothing is missing, I don't have ADO
checked, and the DAO reference is as high as it can go (just below the
VBA and Access 9.0 references, and above the OLE automation and VBA
extensibility references). I've properly (I think) disambiguated the
creation of the Property object, prp. The code compiles.
So am I missing something really obvious? I can't figure this one
out!