过程 Refresh 方法示例 (VB)
以下代码演示如何刷新 Catalog 的 Procedures 集合。 这是访问 Catalog 的 Procedure 对象之前所必需的。
' BeginProceduresRefreshVB
Sub Main()
On Error GoTo ProcedureRefreshError
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.Procedures.Refresh
'Clean up
Set cat.ActiveConnection = Nothing
Set cat = Nothing
Exit Sub
ProcedureRefreshError:
Set cat = Nothing
If Err <> 0 Then
MsgBox Err.Source & "-->" & Err.Description, , "Error"
End If
End Sub
' EndProceduresRefreshVB