Views Delete Method Example (VB)

Microsoft ActiveX Data Objects (ADO)

Views Delete Method Example (VB)

The following code shows how to use the Delete method to delete a view from the catalog.

Sub DeleteView()

    Dim cat As New ADOX.Catalog

    ' Open the catalog
    cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
        "Data Source=c:\Program Files\Microsoft Office\" & _
        "Office\Samples\Northwind.mdb;"

    'Delete the View
    cat.Views.Delete "AllCustomers"

End Sub