Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Valider Specifications d'importation

1 réponse
Avatar
Dante Huapaya
Bonjour à tous,

J’importe un fichier texte (.csv) avec spécification, comment faire pour
valider (avec VBA) l’importation si le fichier texte ne correspond pas aux
paramètres de la spécification?
Merci de votre aide

Carlos Dante

1 réponse

Avatar
Dante Huapaya
Voici un exemple de mon code:

Merci

Private Sub Command10_Click()
On Error GoTo ErrTrap
Dim filename As String

MsgBox "Selectionner votre fichier texte.", vbInformation, ("Mon
application")
filename = getCSVFile()
If filename = "" Then Exit Sub
DoCmd.SetWarnings False
DoCmd.RunSQL ("DELETE * FROM MA_TABLE")
DoCmd.TransferText acImportDelim, "MA_TABLE Import Specification",
"MA_TABLE", filename, -1

MsgBox "Mon Fichier texte est importé!", vbInformation, ("Mon
Application")

ExitPoint:
On Error GoTo 0
Exit Sub
ErrTrap:
MsgBox Err.Number & " - " & Err.Description
Resume ExitPoint
End Sub


"Dante Huapaya" a écrit :

Bonjour à tous,

J’importe un fichier texte (.csv) avec spécification, comment faire pour
valider (avec VBA) l’importation si le fichier texte ne correspond pas aux
paramètres de la spécification?
Merci de votre aide

Carlos Dante