January 19, 201213 yr Is there a way for a script to "know" whether the last login attempt was sucsessful? I would like to use the outcome of the log in as an IF/THEN step. Something like... IF Get (lastloginattempt) = sucsessful perform action.... ELSE IF Get (lastloginattempt) = failed don't allow action.... It would also have to account for the user cancelling out of a log in prompt, or treat that as a failed attempt. I know there's not a Get (lastloginattempt) but I saw a Get (lasterror) which has many error codes pertaining to passwords. I'm not sure how to write the script though since there is no error code generated if the login is successful, and the Get (lasterror) function will return some earlier error NOT pertaining to the log in.
January 20, 201213 yr Author I've been playing around with it in a new, empty DB and I think it might work. Before I tried it, I was thinking that a sucsessful login would not generate a change in the previous 'last error' so there would be nothing to go by. Turns out that a sucsessful log in (followed by a script step that writes the last error to a variable) sets the last error value to 0. I think I will set the variable to something other than 0 before the login script step and if it is 0 after the login step then that provides the "test" that I need to continue the script in one of two directions. Thanks for the idea!
January 20, 201213 yr Immediately after the login, save the get( lasterror ) into a variable. I think you mean "Immediately after the successful login, ...". If the login wasn't successful, then you cannot do anything. Perhaps you were thinking of re-login?
January 20, 201213 yr Author I got it working! Thanks guys! Yes, it was re-login but I knew what he meant.
January 21, 201213 yr I think you mean "Immediately after the successful login, ...". If the login wasn't successful, then you cannot do anything. Perhaps you were thinking of re-login? Yes a re-login. Unless the file has been opened we're not yet in a script.
Create an account or sign in to comment