QMConnect()

Top  Previous  Next

 

The QMConnect() function establishes a QMClient session.

 

 

Format

 

VBQMConnect(ByVal Host as String, ByVal Port as Integer, ByVal UserName as String, ByVal Password as String, ByVal Account as String) as Boolean

 

Cint QMConnect(char * Host, int Port, char * UserName, char * Password, char * Account)

 

ObjBool = Session->Connect(Host, Port, UserName, Password, Account)

 

where

 

Hostis the IP address or name of the server system.

 

Portis the port number to which connection is to be made. Set this to -1 to use the QM default port.

 

UserNameis the user name under which the server process is to run.

 

Passwordis the password for the given UserName.

 

Accountis the name of the QM account to be accessed.

 

 

The QMConnect() function attempts to establish a QMClient process on the system identified by the Host argument. If successful, the function returns True. If unsuccessful, the function returns False and the QMError() function can be used to retrieve a text error message identifying the cause of the failure.

 

Host can reference the local machine. For an alternative method of starting a local QM session, see the QMConnectLocal() function.

 

A single client may open up to four connections simultaneously. The internal session number associated with the session opened by QMConnect() can be retrieved using QMGetSession(). All subsequent QMClient function calls relate to the most recently opened session unless QMSetSession() is used to select an alternative session.

 

QMClient sessions run the LOGIN paragraph (if present) but not the MASTER.LOGIN paragraph. A QMClient session can be recognised within this paragraph by testing the value of @TTY which will be "vbsrvr" for QMClient.