Database Backup

  • Thread starter Thread starter benheaven1
  • Start date Start date
B

benheaven1

Guest
database backup??

A Friend did a database for me and he's done some of the backup wrong. How can I change the specifications for the backup into my own? I've tried changing it but it says it is unable to find the specification on the ones I've changed. Here's what I'm trying to change. Could you tell me for example: How I would do statements for 2003 i.e. How would I do the specification for it and enter it into the module.

Here it is;

Code:
'------------------------------------------------------------
' fullrestore
'
'------------------------------------------------------------
Public Function fullrestore()
Dim VarMsgChk As Integer
On Error GoTo fullrestore_Err

        VarMsgChk = MsgBox("Restore data into database?", vbYesNo, "Restore data")
        If VarMsgChk = vbYes Then
            VarMsgChk = MsgBox("Make sure floppy disk containing backup is inserted?", vbYesNo, "Restore data")
            If VarMsgChk = vbYes Then
            ' Errors
            DoCmd.OpenQuery "qryDeletetblErrors", acNormal, acEdit
            ' Periods
            DoCmd.OpenQuery "qryDeletetblPeriods", acNormal, acEdit
            ' Emergency Covers
            DoCmd.OpenQuery "qryDeletetblEmergencyCover", acNormal, acEdit
            ' Student Caution Levels
            DoCmd.OpenQuery "qryDeletetblStudentCautionLevels", acNormal, acEdit
            ' Student Commendation Levels
            DoCmd.OpenQuery "qryDeletetblStudentCommendationLevels", acNormal, acEdit
            ' Commendation Levels
            DoCmd.OpenQuery "qryDeletetblCommendationLevel", acNormal, acEdit
            ' Commendations
            DoCmd.OpenQuery "qryDeletetblCommendations", acNormal, acEdit
            ' CommendationType
            DoCmd.OpenQuery "qryDeletetblCommendationType", acNormal, acEdit
            ' Caution Levels
            DoCmd.OpenQuery "qryDeletetblCautionLevels", acNormal, acEdit
            ' Cautions
            DoCmd.OpenQuery "qryDeletetblCautions", acNormal, acEdit
            ' Caution Type
            DoCmd.OpenQuery "qryDeletetblCautionType", acNormal, acEdit
            ' Count By TG
            DoCmd.OpenQuery "qryDeletetblCountbyTG", acNormal, acEdit
            ' WeeklyReports
            DoCmd.OpenQuery "qryDeletetblWeeklyReports", acNormal, acEdit
            ' AcTutoring
            DoCmd.OpenQuery "qryDeletetblAcTutoring", acNormal, acEdit
            ' Students
            DoCmd.OpenQuery "qryDeletetblStudents", acNormal, acEdit
            ' TutorGroups
            DoCmd.OpenQuery "qryDeletetblTutorGroups", acNormal, acEdit
            ' Teachers
            DoCmd.OpenQuery "qryDeletetblTeachers", acNormal, acEdit
            ' Subjects
            DoCmd.OpenQuery "qryDeletetblSubjects", acNormal, acEdit
            ' Subjects
            DoCmd.TransferText acImportDelim, "TblSubjects Export Specification", "tblSubjects", "D:\Access Files\Cautions\backup\tblSubjects.txt", False, ""
            ' Teachers
            DoCmd.TransferText acImportDelim, "TblTeachers Export Specification", "tblTeachers", "D:\Access Files\Cautions\backup\tblTeachers.txt", False, ""
            ' TutorGroups
            DoCmd.TransferText acImportDelim, "TblTutorGroups Export Specification", "tblTutorGroups", "D:\Access Files\Cautions\backup\tblTutorGroups.txt", False, ""
            ' Students
            DoCmd.TransferText acImportDelim, "TblStudents Export Specification", "tblStudents", "D:\Access Files\Cautions\backup\tblStudents.txt", False, ""
            ' AcTutoring
            DoCmd.TransferText acImportDelim, "TblAcTutoring Export Specification", "tblAcTutoring", "D:\Access Files\Cautions\backup\tblAcTutoring.txt", False, ""
            ' WeeklyReports
            DoCmd.TransferText acImportDelim, "Tblweeklyreports Export Specification", "tblweeklyreports", "D:\Access Files\Cautions\backup\tblweeklyreports.txt", False, ""
            ' Count By TG
            DoCmd.TransferText acImportDelim, "TblCountbyTG Export Specification", "tblCountbyTG", "D:\Access Files\Cautions\backup\tblCountbyTG.txt", False, ""
            ' Caution Type
            DoCmd.TransferText acImportDelim, "TblCautionType Export Specification", "tblCautionType", "D:\Access Files\Cautions\backup\tblCautionType.txt", False, ""
            ' Cautions
            DoCmd.TransferText acImportDelim, "TblCautions Export Specification", "tblCautions", "D:\Access Files\Cautions\backup\tblCautions.txt", False, ""
            ' Caution Levels
            DoCmd.TransferText acImportDelim, "TblCautionLevels Export Specification", "tblCautionLevels", "D:\Access Files\Cautions\backup\tblCautionLevels.txt", False, ""
            ' Student Caution Levels
            DoCmd.TransferText acImportDelim, "TblStudentCautionLevels Export Specification", "tblStudentCautionLevels", "D:\Access Files\Cautions\backup\tblStudentCautionLevels.txt", False, ""
            ' CommendationType
            DoCmd.TransferText acImportDelim, "TblCommendationType Export Specification", "tblCommendationType", "D:\Access Files\Cautions\backup\tblCommendationType.txt", False, ""
            ' Commendations
            DoCmd.TransferText acImportDelim, "TblCommendations Export Specification", "tblCommendations", "D:\Access Files\Cautions\backup\tblCommendations.txt", False, ""
            ' Commendation Levels
            DoCmd.TransferText acImportDelim, "TblCommendationLevels Export Specification", "tblCommendationLevels", "D:\Access Files\Cautions\backup\tblCommendationLevels.txt", False, ""
            ' Student Commendation Levels
            DoCmd.TransferText acImportDelim, "TblStudentCommendationLevels Export Specification", "tblStudentCommendationLevels", "D:\Access Files\Cautions\backup\tblStudentCommendationLevels.txt", False, ""
            ' Periods
            DoCmd.TransferText acImportDelim, "TblPeriods Export Specification", "tblPeriods", "D:\Access Files\Cautions\backup\tblPeriods.txt", False, ""
            ' Emergency Covers
            DoCmd.TransferText acImportDelim, "TblEmergencyCover Export Specification", "tblEmergencyCover", "D:\Access Files\Cautions\backup\tblEmergencyCover.txt", False, ""
            ' Errors
            DoCmd.TransferText acImportDelim, "TblErrors Export Specification", "tblErrors", "D:\Access Files\Cautions\backup\tblErrors.txt", False, ""
            MsgBox "Process Completed", vbOKOnly, "Data Transfer"
    End If
    End If

fullrestore_Exit:
    Exit Function

fullrestore_Err:
    MsgBox Error$
    Resume fullrestore_Exit

End Function

Thanks In Advance
Merry Christmas To All


Reason for edit: Clarity and CODE tags
 
Last edited by a moderator:
Yeah, yeah, yeah. My apologies to both you.

benheaven1, if you have changed a line of code in here (most likely the name of the import spec) you will get this error. You can create a new spec with the correct fields and it should work. This works fine, but is ugly to maintain. As far as backups are concerned I've always found it easier to just copy the backend db at certain intervals - less coding - less problems. If your database is not split into a front and back end, you will need to do that first. The wizard should be able to help you (database splitter). When you need to restore, just copy and paste the backup of the backend and change the name of the old and the new.
 
Search this forum for - backup and zip code - and you will find what you need to backup a backend as suggested by chenn in the previous post.
HTH
David b
 

Users who are viewing this thread

Back
Top Bottom