The Driver Manager checks that the state of the environment, connection, or statement is appropriate for the function being called. For example, a connection must be in an allocated state when SQLConnect is called; a statement must be in a prepared state when SQLExecute is called. The Driver Manager returns SQL_ERROR for state transition errors.