Examples: Login_LogIntoDataSource()


The following example uses this function in a change script attached to the OK button of a login window. The user selects a data source from a drop-down list named Data_Source_DDL and enters a user ID and password.

local string data_source_name;
local integer status;

data_source_name = itemname(Data_Source_DDL, Data_Source_DDL);
User_ID of table User_Verify = User_ID of window Log_in_Window;
Password of table User_Verify = Password of window Log_in_Window;
status = Login_LogIntoDataSource(data_source_name, User_ID, Password);
if status <> STATUS_SUCCESS then
	case status 
		in [STATUS_ALREADY_LOGGED_IN]
			warning "You're already logged in.";
		in [STATUS_LOGIN_FAILED]
			warning "Your user ID or password was invalid. Try again."; 
		in [STATUS_TOO_MANY_CONNECTIONS]
			warning "No connections are available. Try later.";
	else
		{A status denoting a problem was returned.}
		warning "An error has occurred.";
	end case;
end if;


Documentation Feedback