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
|
Function ImporteDbl1()
Dim NomFich As String
Dim StrSQL1 As String, StrSQL2 As String
Dim NomTbl As String
Dim fd As FileDialog, VPathFic As String
Dim Rqa As String
Dim RapportImports As String, StopImport As Boolean
NomFich = Dir("E:*.dbf")
' tranferer tous les fichiers dbf. de l'emplacement C:/ etc ... Ce qui génére une table nomée 0 dans access puis 1 etc ...
Do While NomFich <> "" And Not StopImport
If ImportDbaseIV("E:\", NomFich, RapportImports, StopImport) Then
'DoCmd.TransferDatabase acImport, "dBase IV", "E:\", , NomFich, False, False
'executer la requete R_Ajouts_TNT
Rqa = "R_Ajouts_TNT"
DoCmd.SetWarnings False
DoCmd.OpenQuery Rqa
' Supprimer la table 0 de la base
DoCmd.DeleteObject acTable, "0"
End If
NomFich = Dir
Loop
If Len(RapportImports) > 0 Then
MsgBox "L'importation a échoué pour les fichiers suivants :" & RapportImports, vbExclamation, "Rapport d'importation"
Else
MsgBox "Tous les fichiers sont importés, Good Job Guy !", vbInformation, "Rapport d'importation"
End If
End Function |
Partager