How To Rebuild Objects From Text Files?
- From: Wayne <cqdigital@xxxxxxxxxxxxxxx>
- Date: Fri, 9 May 2008 02:11:51 -0700 (PDT)
I've read that one method of repairing a misbehaving database is to
save all database objects as text and then rebuild them from the text
files. I've used the following code posted by Lyle Fairfield to
accomplish the first step:
Private Sub SaveObjectsAsText()
path = CurrentProject.path & "\ObjectsAsText\"
SaveDataAccessPagesAsText
SaveFormsAsText
SaveReportsAsText
SaveModulesAsText
MsgBox "All Done Saving Access Objects as Text"
End Sub
Private Sub SaveDataAccessPagesAsText()
Dim FileName As String
Dim Name As String
Dim DataAccessPage As AccessObject
For Each DataAccessPage In CurrentProject.AllDataAccessPages
Name = DataAccessPages.Name
FileName = path & Name & Format(Now(), "yyyymmddhhnn") &
".txt"
SaveAsText acDataAccessPage, Name, FileName
Next DataAccessPage
MsgBox "All Done Saving Data Access Pages as Text"
End Sub
Private Sub SaveFormsAsText()
Dim FileName As String
Dim Name As String
Dim Form As AccessObject
For Each Form In CurrentProject.AllForms
Name = Form.Name
FileName = path & Name & Format(Now(), "yyyymmddhhnn") &
".txt"
SaveAsText acForm, Name, FileName
Next Form
MsgBox "All Done Saving Forms as Text"
End Sub
Private Sub SaveReportsAsText()
Dim FileName As String
Dim Name As String
Dim Report As AccessObject
For Each Report In CurrentProject.AllReports
Name = Report.Name
FileName = path & Name & Format(Now(), "yyyymmddhhnn") &
".txt"
SaveAsText acReport, Name, FileName
Next Report
MsgBox "All Done Saving Reports as Text"
End Sub
Private Sub SaveModulesAsText()
Dim FileName As String
Dim Name As String
Dim Module As AccessObject
For Each Module In CurrentProject.AllModules
Name = Module.Name
FileName = path & Name & Format(Now(), "yyyymmddhhnn") &
".txt"
SaveAsText acModule, Name, FileName
Next Module
MsgBox "All Done Saving Modules as Text"
End Sub
How do I then rebuild the database objects from the text files that
have been created?
.
- Follow-Ups:
- Re: How To Rebuild Objects From Text Files?
- From: Rick Brandt
- Re: How To Rebuild Objects From Text Files?
- From: lyle fairfield
- Re: How To Rebuild Objects From Text Files?
- Prev by Date: query question
- Next by Date: Re: TransferSpread*** to .ADP dbo table
- Previous by thread: query question
- Next by thread: Re: How To Rebuild Objects From Text Files?
- Index(es):