Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »


 
Tests the connection of a user account from an EDMclient to a given EDMserver without performing the actual connection. This function may be used to check that all preconditions for connecting to an EDMserver are met.
Related functions: edmiDefineCommunicationEX, edmiDefineCommunication, edmiGetCommunicationEX, edmiGetCommunication, edmiConnect.
Header:
#include "sdai.h"
Prototype:
EdmiError edmiTestConnect(SdaiString edmUserName,
                           SdaiString edmUserGroup,
                           SdaiString password);
Arguments:

edmUserName

The name of an edmUser in the actual EDMdatabase. User names are case insensitive.

edmUserGroup

The name of an edmGroup in the actual EDMdatabase. This parameter is optional.

password

The password for the edmUser specified by the <edmUserName> argument.

Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an EDMinterface error code. Use edmiGetErrorText to get the error text corresponding to the error code.
Example:
EdmiError rstat;
SdaiString userName = "Johnny";
SdaiString groupName = "Supervisor";
SdaiString password = "4g67fd";
. . .
if (rstat = edmiTestConnect(userName, groupName, password)) {
switch (rstat) { 
case edmiENOUSER: . . .; break;
case edmiEUSERNAME: . . .; break;
case edmiENOGROUP: . . .; break;
case edmiEGROUPNAME: . . .; break;
case edmiEPASSWORDREQUIRED:. . .; break;
case edmiEPASSWORD: . . .; break;
case edmiEWRONGPASSWORD: . . .; break;
case edmiETOOMANYCONNECTIONS: . . .; break;
case edmiEUSERNOTINGROUP: . . .; break;
case edmiEUNAVAILABLE: . . .; break;
case edmiE_STOPPED: . . .; break;
case edmiECOMMTIMEOUT: . . .; break;
default: . . .; break;

printf("\nError %d: Test Connect failed - %s", rstat, 
edmiGetErrorText(rstat)); 
goto err; 
}
rstat = edmiConnect(userName, groupName, password);
. . .

  • No labels