Ascertaining whether a Project is password protected

P

pmartin1960

Hi all

My VB6 app scans a folder for MS Access files, and I need to ascertain
whether a found file has a password protected VB Project. My current
code is:

Dim objAccess As New Access.Application
Dim blnProtected as Boolean

objAccess.OpenCurrentDatabase FileName
blnProtected = (objAccess.VBE.VBProjects(1).Protection =
vbext_pp_locked)

Is this correct? Is there a better test for project protection? Note
that 1 may not be the correct index for VBProjects.

Thanks in advance

Paul Martin
Melbourne, Australia
 

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