Home | Sign in | English UK
  • Limitation
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
SNMPStartSession (Function)
In french: SNMPOuvreSession
Starts an SNMP session.
SessionID is int
// Start a session
SessionID = SNMPStartSession("TestDoc", "public")
IF SessionID = -1 THEN Error("Error while opening the session " + ErrorInfo())
<Result> = SNMPStartSession(<Agent address> , <SNMP community> [, <Timeout> [, <Port number>]])
<Result>: Integer
  • Identifier of SNMP session,
  • -1 if an error occurred. ErrorInfo returns more details about the problem.
<Agent address>: Character string (with quotes)
Address of agent with which the communication via SNMP will be established. This address can be given in the following format:
  • IP address in XXX.XXX.XXX.XXX format ( for example).
  • URL containing the server name (www.windev.com for example). This syntax is recommended.
<SNMP community>: Character string (with quotes)
Name of SNMP community used by the connection. This community indicates the rights associated with the SNMP session. In most cases, all the SNMP agents support the "public" community in read-only mode. Other communities can exist (private for example) for the access in read/write.
<Timeout>: Optional integer or optional Duration
Timeout (in milliseconds) of an SNMP request. This value must be included between 1000 and 10000. This parameter can correspond to:
  • an integer corresponding to the number of milliseconds,
  • a Duration variable,
  • Versions 23 and later
    the direct indication of duration (1 s or 10 ms for example).
    New in version 23
    the direct indication of duration (1 s or 10 ms for example).
    the direct indication of duration (1 s or 10 ms for example).
This parameter is set to 5000 by default (5 seconds).
<Port number>: Optional integer
Number of the port to which we must connect. This value is set to 161 by default (standard SNMP port).


The SNMPxxx functions can only be used from Windows 2000 (they cannot be used with the following systems: Windows 98, Me or NT4).
SNMP is using the UDP protocol that is a connectionless protocol. Therefore, SNMPStartSession does not allow you to find out whether the contacted agent can actually be joined. SNMPStartSession returns a session once the SNMP request was sent, even if the agent is not available. To check whether an agent is actually connected, you have the ability to use:
Component : wd250com.dll
Minimum version required
  • Version 12
This page is also available for…
Click [Add] to post a comment