You can refer the User ID field from connection string to get user Id (sample connection string is given below):
OLEDB CONNECT32 TO [Provider=SQLOLEDB.1;Persist Security Info=True;User ID=sa;Initial Catalog=AdventureWorksDW2008R2;Data Source=RAHUL-PAWAR\SS2K8R2;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=RAHUL-PAWAR;Use Encryption for Data=False;Tag with column collation when possible=False] (XPassword is JABcBYFMTbcOXXJOETHB);
It seems that you are using ODBC connection type using DSN with name MYDATABASE. You can find the the UserId in two ways:
1. Go to the ODBC Data Sources; locate the DSN with MYDATABASE and press configure button. On the next screen you can see the User Name field
2. In Edit Script, go to the Database section & select ODBC option. Post that press Connect. Select the ODBC with MYDATABASE name & Press OK. This will trigger a screen inquiring connection details; there you could find User Name.
You must have a driver installed in the server where the QlikView Distribution Service reloads, so you will need to update that driver there. Note that DSNs may have the user and password in their definition, so you may need to change them there.
Finally, note also that there are two odbcad32.exe for 32-bit and 64-bit connections. Although the name of the file is the same, they are in different folders
I'm not aware of any limitation other than the operating system and driver, but that's way longer than 20 characters. I have some deployments with usernames of 19 to 23 characters long working just fine.
I also checked that within Qlik Repo DB, it's 500+ characters so it's not a Qlik Sense issue but from AD itself.
I verified within here SAM-Account-Name attribute (Windows) that AD syncs users with this atribute "SAM-Account-Name" that limits it to 20 characters because of older Windows versions. Is there a workaround so I can fetch the full lenght of the userid within AD?