ISNMP::Set method

The Set method enables an ASP Web page to associate a value with an SNMP OID.

Syntax

HRESULT Set(
  [in]  BSTR    bstrOID,
  [out] VARIANT varValue
);

Parameters

bstrOID [in]
Caller-supplied pointer to an SNMP OID string.

varValue [out]
Caller-supplied location containing the OID's value.

Return value

Win32 error codes can also be returned.

Return code Description
S_OK The operation succeeded.
E_FAIL The ISNMP::Open method has not been called.
E_INVALIDARG The specified SNMP OID is not valid.
E_OUTOFMEMORY Out of memory.

VBScript example

This method calls the SnmpMgrRequest function to set SNMP OID values.

The ISNMP::Open method must be called before the ISNMP::Set method can be called.

Dim StrIP, strCommunity, objSNMP, OIDValue
strIP = Session("MS_IPaddress")
strCommunity = Session ("MS_Community")
Set objSNMP = Server.CreateObject("OlePrn.OleSNMP")
objSNMP.Open strIP, strCommunity, 2, 1000
...
' Determine value to assign to OID; store it in OIDValue.
...
objSNMP.Set ("43.18.1.1.2", OIDValue)

Requirements

Target platform: Desktop

Header: Olesnmp.h

See also

ISNMP::Open