QPR Knowledge Base

ConnectToServer

Hide Navigation Pane

ConnectToServer

Previous topic Next topic No expanding text in this topic  

ConnectToServer

Previous topic Next topic JavaScript is required for expanding text Mail us feedback on this topic!  

Comments (...)

Revision history:

Introduced in QPR 7.2.1

Last changed in QPR 8.1.1 SP7

 

Connect to application server. If development client is already connected to server, then the existing connection is closed first. The server address and port must be named, i.e. they must be found on the Server Connections list of the QPR ScoreCard Designer.

 

Synopsis:

 

SCApplication.ConnectToServer(ServerAddress, Port)

 

Parameters:

 

ServerAddress: String, name or IP address of the server. The used address must be identical to the Host address defined in the QPR ScoreCard Designer Server Properties. For example: if the Host is defined as a host name in QPR ScoreCard Designer, the same host name must be used in the script, i.e. the IP address cannot be used with that connection.

Port: Integer, portnumber. The port number must be identical to the port number defined in the QPR ScoreCard Designer Server Properties.

 

Required Rights:

 

None

 

Return Values:

Below are listed the return values that this function can return:

 

RV_INVALID_PORT_NUMBER

RV_CANCELLED

RV_SUCCESS

RV_CANNOT_SAVE_SERVERADDRESS

RV_CANNOT_CONNECT_TO_SERVER

 

Example Procedure:

 

Sub ConnectToServerAndAuthenticate()

 Dim iResult

 Dim oModel

 iResult = SCApplication.ConnectToServer("127.0.0.1", 2618)

 If (iResult <> 0) Then

   MsgBox "Could not connect to default server: " + SCApplication.GetErrorMessage(iResult)

 End If

 iResult = SCApplication.Authenticate("qpr", "demo", "")

 If (iResult <> 0) Then

   MsgBox "Authentication failed: " + SCApplication.GetErrorMessage(iResult)

 End If

End Sub

 

Comments (...)