1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
Set acApp = New Access.Application
acApp.OpenCurrentDatabase stBase2, True, stPassWord
DoCmd.SetWarnings False
With acApp
Set DbPermanent = DBEngine.OpenDatabase(stBase1) 'Base permamente
For Each tdf In DbPermanent.TableDefs
If (tdf.Attributes And dbSystemObject) = 0 Then ' enlève les tables systèmes
stTab0 = tdf.Name
acApp.DoCmd.TransferDatabase acImport, "Microsoft Access", stBase1, acTable, stTab0, stTab0
Debug.Print tdf.Name
End If
Next
stSQL = "DELETE * FROM T_MOD " _
& " WHERE C_MOD_NMOD not IN " _
& " (SELECT C_RMI_NMOD FROM T_RRE;);"
.DoCmd.RunSQL stSQL
....
End With
...
Erreur:
Traite_Table = -3
DoCmd.SetWarnings True
Set acApp = Nothing
End Function |
Partager