Validate Mysql Username and Password

  1. 6 years ago

    TheMexican

    15 Sep 2017 User since 2016

    I have a window with a username and password TextFields. The Window also has a MysqlDatabase Object with the properties username and password empty.
    What I want is to validate the username and password used to connect to the database.
    I noticed the MySQLdatabase Object has a connect() method but it doesn't return anything. How can I validate username and password. This is the code I have on the Button Action to login:

    wsDB.username = txtUsername.text;
    awsDB.password = txtPassword.text;
    awsDB.database = "shift";
    
    awsDB.connect();
    
    if (awsDB.isError){
    	lblError.text = "Invalid username or password";
    lblError.hidden = false;
    Console.write(awsDB.errorCode + " --" + awsDB.errorMessage);
    }
    else{
    	awsDB.close();	
    	Patients.open();
    }
    

    Any suggestions??

  2. marco

    16 Sep 2017 Administrator User since 2016

    Hi @TheMexican what about using the isConnected property?

or Sign Up to reply!