Delete-Methode für Prozeduren – Beispiel (VB)

Der folgende Code veranschaulicht, wie Sie eine Prozedur mithilfe der Delete-Methode der Procedure-Auflistung löschen.

' BeginDeleteProcedureVB  
Sub Main()  
    On Error GoTo DeleteProcedureError  
  
    Dim cat As New ADOX.Catalog  
  
    ' Open the catalog.  
    cat.ActiveConnection = _  
        "Provider='Microsoft.Jet.OLEDB.4.0';" & _  
        "Data Source='Northwind.mdb';"  
  
    ' Delete the procedure.  
    cat.Procedures.Delete "CustomerById"  
  
    'Clean up.  
    Set cat.ActiveConnection = Nothing  
    Set cat = Nothing  
    Exit Sub  
  
DeleteProcedureError:  
    Set cat = Nothing  
  
    If Err <> 0 Then  
        MsgBox Err.Source & "-->" & Err.Description, , "Error"  
    End If  
End Sub  
' EndDeleteProcedureVB  

Weitere Informationen

ActiveConnection-Eigenschaft (ADOX)
Catalog-Objekt (ADOX)
Delete-Methode (ADOX-Collections)
Procedure-Objekt (ADOX)
Procedures-Collection (ADOX)