QPR Installation Instructions



Previous topic Next topic  


Previous topic Next topic JavaScript is required for the print function  

Revision history:

Introduced in QPR 7.2.1


Authenticates the user. If a model is open, it is closed first. Calling this function is not mandatory in script functions: if no user is authenticated when some other script function is called, login dialog is shown and the user can authenticate during the execution of the script (if the user interface is not hidden, see SetUIMode).




SCApplication.Authenticate(username, password, domain)




Username: Username for logging into the server. String

Password: Password of the user defined in the User parameter. String

Domain: The domain that contains the user account defined in the User parameter. Can be left empty if NT authentication is not used. String


If empty parameters are given, authentication is done with Integrated Windows Authentication. See Security Level for Executing QPR Script for instructions on how to allow IWA.


Required Rights:




Return Values:

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







Example Procedure:


Sub ConnectToServerAndAuthenticate()

 Dim iResult

 Dim oModel

 iResult = SCApplication.ConnectToServer("", 0)

 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