共用方式為


Procedures Delete 方法範例 (VB)

下列程式碼示範如何使用 Procedures 集合的 Delete 方法,刪除程序。

' 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  

另請參閱

ActiveConnection 屬性 (ADOX)
Catalog 物件 (ADOX)
Delete 方法 (ADOX Collections)
Procedure 物件 (ADOX)
Procedures 集合 (ADOX)