Variable Object : Value Property |
Visual Basic |
---|
Public Property Value As Variant |
To set this property, use Variable.SetValue() or create the Variable object with MibNode.CreateVariable().
The following chart outlines the data type the variant contains for each SNMP data type:
SNMP Data Type | Basic Type | VB6 Type |
---|---|---|
OctetString | Byte array | Byte() |
Opaque | Byte array | Byte() |
NSAP | Byte array | Byte() |
Counter | Unsigned 32-bit Integer | No compatible VB6 type. Use Variable.ValueAsString to access the value. |
Counter64 | Unsigned 64-bit Integer | No compatible VB6 type. Use Variable.ValueAsString to access the value. |
Gauge | Unsigned 32-bit Integer | No compatible VB6 type. Use Variable.ValueAsString to access the value. |
TimeTicks | Unsigned 32-bit Integer | No compatible VB6 type. Use Variable.ValueAsString to access the value. |
Integer | Signed 32-bit Integer | Long |
UInteger | Unsigned 32-bit Integer | No compatible VB6 type. Use Variable.ValueAsString to access the value. |
ObjectID | String | String |
IPAddress | String | String |
EndOfMibView | Null | Nothing |
NoSuchInstance | Null | Nothing |
NoSuchObject | Null | Nothing |
Null | Null | Nothing |
As above, VB6 does not support 64-bit integers or unsigned 32-bit integers, so ValueAsString must be used to get the value of a Counter, Counter64, Gauge, TimeTicks or UInteger Variable.
Variable.Type may be checked to determine the SNMP data type to inform the application how to handle the variant value.