Export (0) Print
Expand All
Expand Minimize

Procedures Delete Method Example (VB)

The following code demonstrates how to delete a procedure by using the Delete method of the Procedures collection.

' 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
    Set cat = Nothing
    If Err <> 0 Then
        MsgBox Err.Source & "-->" & Err.Description, , "Error"
    End If
End Sub
' EndDeleteProcedureVB
© 2014 Microsoft