Giorgio-
If the database itself is password protected, I don't know of any way to detect that without trying to open the database and getting an error.
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
(Paris, France)
From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of giorgio_rovelli
Sent: Thursday, October 24, 2013 8:48 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] How to avoid opening a password-protected mdb
I'm looping through my pc's folders to open each mdb that I find and look for a sub in the vba modules. The problem is there are a few mdb's which have been password-protected and so I'd like to skip opening them since I don't know the password. How can I modify the following code to achieve that?
Sub ProcessDatabase(ByVal strPath As String)
Dim vbc As VBIDE.VBComponent
app.OpenCurrentDatabase strPath
For Each vbc In app.VBE.ActiveVBProject.VBComponents
ProcessModule vbc.CodeModule, strPath
Next vbc
app.CloseCurrentDatabase
End Sub
Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (2) |
Tidak ada komentar:
Posting Komentar