Ecountering the error "Error 9921 (Error returned by the driver via the connection)" on a call to SQL LOGIN may signify a problem with the ODBC driver passed in the command's first parameter. Choosing the correct ODBC driver and bitness is important to setup an ODBC connection. When determining the correct ODBC Driver to be used, it should be host database's ODBC driver and the bitness of the driver should match the client application making the ODBC connection.
If a 64-bit 4D applicaiton (the client) wants to use ODBC to access a MS SQL Server (the host), the correct ODBC Driver would be the ODBC Driver for SQL Server 64-bit.
The command GET DATA SOURCE LIST can helpful to see the available system data source names and their ODBC Driver that matches the current 4D architecture (32-bit or 64-bit)