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 ExisteTable(Nomtable As String) As Boolean
On Error GoTo err:
Dim MCat As New ADOX.Catalog
Dim MTable As ADOX.Table
Set MCat.ActiveConnection = CurrentProject.Connection
Set MTable = MCat.Tables(Nomtable)
ExisteTable = True
err:
Set MCat = Nothing
Set MTable = Nothing
Exit Function
End Function
Function SupprimerTable(Nomtable As String) As Boolean
On Error GoTo err
Dim MCat As New ADOX.Catalog
Set MCat.ActiveConnection = CurrentProject.Connection
MCat.Tables.Delete (Nomtable)
SupprimerTable = True
err:
Set MCat = Nothing
Exit Function
End Function
' Ca donne
If ExisteTable("latable") = True Then SupprimerTable "latable" |