On May 9, 5:11=A0am, Wayne <cqdigi...@[EMAIL PROTECTED]
> wrote:
> 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. =A0I've used the following code posted by Lyle Fairfield to
> accomplish the first step:
>
> Private Sub SaveObjectsAsText()
> =A0 =A0 path =3D CurrentProject.path & "\ObjectsAsText\"
> =A0 =A0 SaveDataAccessPagesAsText
> =A0 =A0 SaveFormsAsText
> =A0 =A0 SaveRe****tsAsText
> =A0 =A0 SaveModulesAsText
> =A0 =A0 MsgBox "All Done Saving Access Objects as Text"
> End Sub
>
> Private Sub SaveDataAccessPagesAsText()
> =A0 =A0 Dim FileName As String
> =A0 =A0 Dim Name As String
> =A0 =A0 Dim DataAccessPage As AccessObject
> =A0 =A0 For Each DataAccessPage In CurrentProject.AllDataAccessPages
> =A0 =A0 =A0 =A0 Name =3D DataAccessPages.Name
> =A0 =A0 =A0 =A0 FileName =3D path & Name & Format(Now(), "yyyymmddhhnn")
&=
> ".txt"
> =A0 =A0 =A0 =A0 SaveAsText acDataAccessPage, Name, FileName
> =A0 =A0 Next DataAccessPage
> MsgBox "All Done Saving Data Access Pages as Text"
> End Sub
>
> Private Sub SaveFormsAsText()
> =A0 =A0 Dim FileName As String
> =A0 =A0 Dim Name As String
> =A0 =A0 Dim Form As AccessObject
> =A0 =A0 For Each Form In CurrentProject.AllForms
> =A0 =A0 =A0 =A0 Name =3D Form.Name
> =A0 =A0 =A0 =A0 FileName =3D path & Name & Format(Now(), "yyyymmddhhnn")
&=
> ".txt"
> =A0 =A0 =A0 =A0 SaveAsText acForm, Name, FileName
> =A0 =A0 Next Form
> MsgBox "All Done Saving Forms as Text"
> End Sub
>
> Private Sub SaveRe****tsAsText()
> =A0 =A0 Dim FileName As String
> =A0 =A0 Dim Name As String
> =A0 =A0 Dim Re****t As AccessObject
> =A0 =A0 For Each Re****t In CurrentProject.AllRe****ts
> =A0 =A0 =A0 =A0 Name =3D Re****t.Name
> =A0 =A0 =A0 =A0 FileName =3D path & Name & Format(Now(), "yyyymmddhhnn")
&=
> ".txt"
> =A0 =A0 =A0 =A0 SaveAsText acRe****t, Name, FileName
> =A0 =A0 Next Re****t
> MsgBox "All Done Saving Re****ts as Text"
> End Sub
>
> Private Sub SaveModulesAsText()
> =A0 =A0 Dim FileName As String
> =A0 =A0 Dim Name As String
> =A0 =A0 Dim Module As AccessObject
> =A0 =A0 For Each Module In CurrentProject.AllModules
> =A0 =A0 =A0 =A0 Name =3D Module.Name
> =A0 =A0 =A0 =A0 FileName =3D path & Name & Format(Now(), "yyyymmddhhnn")
&=
> ".txt"
> =A0 =A0 =A0 =A0 SaveAsText acModule, Name, FileName
> =A0 =A0 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?
Did I ever post this half-page? The whole pages can be found at:
http://www.ffdba.com/downloads/Save_MDB_Objects_As_Text.htm
or
http://www.ffdba.com/downloads/Save_ADP_Objects_As_Text.htm
http://www.ffdba.com/downloads/Save_MDB_Objects_As_Text.dat
or
http://www.ffdba.com/downloads/Save_ADP_Objects_As_Text.dat
for download,
Use the whole page or module.


|