適用先: Access 2013、Office 2013
次のコードでは、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='c:\Program Files\" & _
"Microsoft Office\Office\Samples\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