Question : Delete Access Query using ADOX

I'm trying to use the code below to delete a query in MSAccess and it fails on the last line.

        Dim dbConn As New ADODB.Connection
        dbConn.Open(CONN)
        Dim Cat1 As New ADOX.Catalog
        Cat1.let_ActiveConnection(dbConn)
        Dim View1 As ADOX.View = Cat1.Views.Item("Query1")
        Cat1.Views.Delete(View1)

Answer : Delete Access Query using ADOX

Have you tired:
Cat1.Views.Delete ("Query1")

Dave
Random Solutions  
 
programming4us programming4us