1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Public Function SaveDbAsText() Dim app As Access.Application, dbs As DAO.Database,
strDbName As String
'For example: strDbName = "C:\MyFolder\MyCorruptedDb.mdb"
'New instance of access Set app = New Access.Application
With app 'Open corrupt db .OpenCurrentDatabase strDbName, True
'Useful for looping through the collections Set dbs = .CurrentDb
'Can't prevent AutoExec macro from running, so close whatever forms it might have opened .DoCmd.Close acForm, "frmMain"
'Now you can, for example: .SaveAsText acForm, "frmMyForm",
"C:\frmMyForm.txt"
'... 'Code for looping through collections and saving all modules to specified directories
'Clean up .CloseCurrentDatabase .Quit
Set app = Nothing End With End Function |
Partager