Solved

Roll Back Access 2013 app to Access 2007

Posted on 2013-12-26
5
1,159 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 38

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 38

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

691 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