Sub Delete_StoredProc()
Dim conn As ADODB.Connection
On Error GoTo ErrorHandler
Set conn = CurrentProject.Connection
conn.Execute "DROP PROCEDURE procName; "
ExitHere:
If Not conn Is Nothing Then
If conn.State = adStateOpen Then conn.Close
End If
Set conn = Nothing
Exit Sub
ErrorHandler:
If InStr(1, Err.Description, "cannot find") Then
Debug.Print "The procedure you want to delete does not exist."
Else
Debug.Print Err.Number & ":" & Err.Description
End If
Resume ExitHere
End Sub
|