I guess you want to know how I did it!
The following is the code;
(1) queries - I print the SQL as the queries whose names being with "~" come from VBA (so I have heard) so by printing the sql you can recreate the query manually
(2) tables work
(3) forms without VBA
(4) modules - no luck
Code:
Public Function aaa()
Dim appAccess As Access.Application, qdf As QueryDef, tdf As TableDef, obj As AccessObject, doc As DAO.Document
Dim db As Database
Dim tdefs As TableDefs, tdef As TableDef
Set db = DBEngine.OpenDatabase("c:\users\downloads\cgpap1.accdb")
For Each qdf In db.QueryDefs
DoCmd.TransferDatabase acImport, "Microsoft Access", db.Name, acQuery, qdf.Name, qdf.Name
Debug.Print qdf.Name & " " & qdf.SQL
Next
'For Each tdf In db.TableDefs
' If Left(tdf.Name, 1) <> "~" And Left(tdf.Name, 4) <> "MSYS" And tdf.Connect = "" Then
' Debug.Print tdf.Name
' DoCmd.TransferDatabase acImport, "Microsoft Access", db.Name, acTable, tdf.Name, tdf.Name
' End If
'Next
'For Each doc In db.Containers("Forms").Documents
' Debug.Print doc.Name
' SaveAsText acForm, doc.Name, "c:\users\taylor\downloads\" & doc.Name & "txt"
' 'DoCmd.TransferDatabase acImport, "Microsoft Access", db.Name, acForm, doc.Name, doc.Name
'Next
'For Each doc In db.Containers("Modules").Documents
' Debug.Print doc.Name
' DoCmd.TransferDatabase acImport, "Microsoft Access", db.Name, acModule, doc.Name, doc.Name
'Next
End Function