Skip to content

Latest commit

 

History

History
51 lines (42 loc) · 1.3 KB

views-refresh-method-example-vb.md

File metadata and controls

51 lines (42 loc) · 1.3 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords dev_langs
Views Refresh Method Example (VB)
Views Refresh Method Example (VB)
rothja
jroth
01/19/2017
sql
ado
reference
Refresh method [ADOX]
VB

Views Refresh Method Example (VB)

The following code shows how to refresh the Views collection of a Catalog. This is required before View objects from the Catalog can be accessed.

' BeginViewsRefreshVB  
Sub Main()  
    On Error GoTo ProcedureViewsRefreshError  
  
    Dim cat As New ADOX.Catalog  
  
    ' Open the catalog.  
    cat.ActiveConnection = "Provider='Microsoft.Jet.OLEDB.4.0';" & _  
        "Data Source='Northwind.mdb';"  
  
    ' Refresh the Procedures collection.  
    cat.Views.Refresh  
  
    'Clean up  
    Set cat = Nothing  
    Exit Sub  
  
ProcedureViewsRefreshError:  
  
    If Not cat Is Nothing Then  
        Set cat = Nothing  
    End If  
  
    If Err <> 0 Then  
        MsgBox Err.Source & "-->" & Err.Description, , "Error"  
    End If  
End Sub  
' EndViewsRefreshVB  

See Also

Refresh Method (ADO)
Views Collection (ADOX)