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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
Case "API"
For x = 1 To 3 'Boucle pour injecter les les tables dans les trois fichiers Access
Select Case x
Case 1
Call Fichier_Excel_Pour_Access_V3R7
Case 2
Call Fichier_Excel_Pour_Access_V4R1
Case 3
Call Fichier_Excel_Pour_Access_V4R2
End Select
'******** Mettre code pour modifier taille du champ!
If Cells.Find("*") Is Nothing Then 'savoir si la feuille est vide
Else
Call Ouverture_Connection_Access_ADO
For y = 1 To Derniere_ligne
With rs
' Créer un enregistrement
.AddNew
' ajouter les valeurs à chaque champ de l'enregistrement
.Fields("CODE") = Cells(y, 1)
.Fields("LIBELLE") = Cells(y, 2)
.Fields("FABRICANT") = Cells(y, 3)
.Fields("SERIE") = Cells(y, 4)
.Fields("PRODUIT") = Cells(y, 5)
.Fields("CATEGORIE") = Cells(y, 6)
.Fields("RACK") = Cells(y, 7)
.Fields("ALIM") = Cells(y, 8)
.Fields("COURANT") = Cells(y, 9)
.Fields("NBRE_VOIE") = Cells(y, 10) 'Faire code vba pour augmenter la taille de caractère
.Fields("NBRE_EXT") = Cells(y, 11)
.Fields("DX") = Cells(y, 12)
.Fields("DY") = Cells(y, 13)
.Fields("DZ") = Cells(y, 14)
.Fields("POIDS") = Cells(y, 15)
.Fields("CODE_INT") = Cells(y, 16)
.Fields("CODE_EAN") = Cells(y, 17)
.Fields("CODE_VIRT") = Cells(y, 18)
.Fields("CODE_EXT") = Cells(y, 19)
.Fields("PRIXHT") = Cells(y, 20)
.Fields("UNITFACT") = Cells(y, 21)
.Fields("COLISAGE") = Cells(y, 22)
.Fields("ACCESSOIR") = Cells(y, 23)
.Fields("SYMBOLE") = Cells(y, 24)
.Fields("IMPLANTE") = Cells(y, 25)
.Fields("VIGNETTE") = Cells(y, 26)
.Fields("VUE_YZ") = Cells(y, 27)
.Fields("VUE_XZ") = Cells(y, 28)
.Fields("EQUIPEMEN") = Cells(y, 29)
'.Fields("DATE") = Cells(y, 30)
.Fields("WEB") = Cells(y, 31)
'.Fields("PICTURE") = Cells(y, 32)
'.Fields("{SEE_SET}") = Cells(y, 33)
'.Fields("{SEE_CONTACTS_ID}") = Cells(y, 34)
.Update
End With
Next y
Call Fermeture_Connection_Access_ADO
End If
Next x |
Partager