רשימת מודול בקובץ אקסס
-
@ארי בבקשה:
למקרה של קובץ עם סיסמה יש לספק אותה כמובן, בארגומנט השני.Public Sub GetListOfModulesFromDB(dbPath As String, Optional dbPassword As String = "") On Error GoTo ErrHandler Dim db As DAO.Database Dim cnt As DAO.Container Dim doc As DAO.Document Dim connectionString As String connectionString = "MS Access" If dbPassword <> "" Then connectionString = connectionString & ";PWD=" & dbPassword Set db = DBEngine.OpenDatabase(dbPath, False, False, connectionString) 'Loop through all modules Set cnt = db.Containers("Modules") If cnt Is Nothing Then GoTo ExitHandler For Each doc In cnt.Documents Debug.Print doc.Name Next doc ExitHandler: If Not db Is Nothing Then db.Close Exit Sub ErrHandler: MsgBox "GetListOfModulesFromDB Error: " & vbNewLine & Err.Number & " " & Err.Description Resume ExitHandler End Sub