Solved

Roll Back Access 2013 app to Access 2007

Posted on 2013-12-26
5
1,148 Views
Last Modified: 2014-01-09
I have an Access 2013 application that needs to be converted back to Access 2007. The application was originally in 2007. When trying to import the objects from 2013 to 2007, Access 2007 does not recognize the 2013 database. From 2013, I can export one object at a time, but this is very time consuming. In the 2013 database, I tried writing a function to export all objects at once, but it doesn't work. Below is that function. Any help with the function, or other ideas to roll back would be appreciated.

Function Export_2007()
DoCmd.TransferDatabase acExport, "Microsoft Access", , "c:\client_db\clients.accdb", , "C:\Users\Don\Documents\client_new.accdb", False
End Function
0
Comment
Question by:dgravitt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 37

Expert Comment

by:PatHartman
ID: 39740453
The database formats are the same so if A2007 doesn't recognize the database, it is because you have used A2013 features and won't be able to transfer them in any event.  I have a procedure I use when I am trying to fix corruption.  It exports everything to text files.  You can then write a procedure to re-import them.  I don't have that one with me.

Public Sub ExportDatabaseObjects(ExportType As String)
On Error GoTo Err_ExportDatabaseObjects
    
    'Dim db As Database
    Dim db As DAO.Database
    Dim td As DAO.TableDef
    Dim D As Document
    Dim C As Container
    Dim i As Integer
    Dim sExportLocation As String
    
    Set db = CurrentDb()
''import from text =
''application.Application.LoadFromText acForm, "frmRisks","C:\Temp\TextRiskReview070615\Form_frmRisks.txt"


    sExportLocation = "C:\Data\Work\Maggio\TextObjects\" 'Do not forget the closing back slash! ie: C:\Temp\
    
    Select Case ExportType
        Case "TableDefs"
            For Each td In db.TableDefs 'Tables
                If Left(td.Name, 4) <> "MSys" Then
                    DoCmd.TransferText acExportDelim, , td.Name, sExportLocation & "Table_" & td.Name & ".txt", True
                End If
            Next td
        Case "Forms"
            Set C = db.Containers("Forms")
            For Each D In C.Documents
                Application.SaveAsText acForm, D.Name, sExportLocation & "Form_" & D.Name & ".txt"
            Next D
        Case "Reports"
            Set C = db.Containers("Reports")
            For Each D In C.Documents
                Application.SaveAsText acReport, D.Name, sExportLocation & "Report_" & D.Name & ".txt"
            Next D
        Case "Scripts"
            Set C = db.Containers("Scripts")
            For Each D In C.Documents
                Application.SaveAsText acMacro, D.Name, sExportLocation & "Macro_" & D.Name & ".txt"
            Next D
        Case "Modules"
            Set C = db.Containers("Modules")
            For Each D In C.Documents
                Application.SaveAsText acModule, D.Name, sExportLocation & "Module_" & D.Name & ".txt"
            Next D
        Case "QueryDefs"
            For i = 0 To db.QueryDefs.Count - 1
                Application.SaveAsText acQuery, db.QueryDefs(i).Name, sExportLocation & "Query_" & db.QueryDefs(i).Name & ".txt"
            Next i
        Case Else
    End Select

    Set db = Nothing
    Set C = Nothing
    
    MsgBox "All database objects have been exported as a text file to " & sExportLocation, vbInformation
    
Exit_ExportDatabaseObjects:
    Exit Sub
    
Err_ExportDatabaseObjects:
    MsgBox Err.Number & " - " & Err.Description
    Resume Exit_ExportDatabaseObjects
    
End Sub

Open in new window

0
 

Author Comment

by:dgravitt
ID: 39740488
thanks, I'll run this. When you get to the import procedure, it would be appreciated. I need the queries and modules the most. Is there a way to discovery which objects have 2013 features?
0
 
LVL 37

Accepted Solution

by:
PatHartman earned 500 total points
ID: 39740547
Here's the code to import a single form.
Public Sub ImportForm()
Dim strPath As String
    strPath = "C:\Data\Work\Form_"
    Application.Application.LoadFromText acForm, "frmLogDrawings", strPath & "frmLogDrawingsBAD" & ".txt"
End Sub

Open in new window

It is the bulk import I don't have handy.  You can take this and extrapolate it into a bulk import.

I think the only way you'll discover the a2013 features is when the import for the object fails so be sure to include good error trapping.
0
 

Author Comment

by:dgravitt
ID: 39751066
Sorry I haven't been able to work on this during the holidays. Hope to try these suggestions within the next few days. Thanks for the suggestions.
0
 

Author Closing Comment

by:dgravitt
ID: 39769190
Thanks for the help!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question