Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
thomas_wang
Creator
Creator

How can I decode a pair of XUserID and XPassword in ODBC Connector?

Hi All,

I have read the topic "How to generate xuser & xpassword in txt file".

but the VBScript provided from the answer cannot be run and report syntax errors in my QlikView,

Any other ideas?

Thanks!

1 Solution

Accepted Solutions
vhayward
Partner - Contributor III
Partner - Contributor III

I have a much easier solution to decrypt the XPASSWORD.

OLEDB CONNECT TO [Provider=SQLOLEDB.1;Persist Security Info=True;User ID=sql_user;Initial Catalog=DBSQL;Data Source=13.37.13.37;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=QLIKVIEW;Use Encryption for Data=False;Tag with column collation when possible=False] (XPassword is XXXXXXXXXXXXXXXXXXXXXXX);

LET vPassword = REPLACE(CONNECTSTRING(), ';', '.');

TRACE $(vPassword);

View solution in original post

7 Replies
thomas_wang
Creator
Creator
Author

In the VBScript, I deleted the underline and merged the context into the same line. No syntax errors were reported again, but the result of conversion was garbled.

thomas_wang
Creator
Creator
Author

Here I found my own way:

1. Rename the connection string that you have defined before.

2. Reload.

3. Then you will receive an error "SQL##f - SqlState: 28000, ErrorCode: 18456, ErrorMsg: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'XXX'." Note that the last XXX is the original username.

4. Modify the connection parameters again to copy the XPassword to the XUserID.

5. Reload again.

6. Then you will receive an similar error. Note that this time the last XXX is the original password.

vhayward
Partner - Contributor III
Partner - Contributor III

I have a much easier solution to decrypt the XPASSWORD.

OLEDB CONNECT TO [Provider=SQLOLEDB.1;Persist Security Info=True;User ID=sql_user;Initial Catalog=DBSQL;Data Source=13.37.13.37;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=QLIKVIEW;Use Encryption for Data=False;Tag with column collation when possible=False] (XPassword is XXXXXXXXXXXXXXXXXXXXXXX);

LET vPassword = REPLACE(CONNECTSTRING(), ';', '.');

TRACE $(vPassword);

thomas_wang
Creator
Creator
Author

If the connection string works, the CONNECTSTRING() function returns detailed connection information including the plaintext username and password.

Replace(ConnectString(), ';', '\n')

rzenere_avvale
Partner - Specialist II
Partner - Specialist II

Great solution, I didn't know that function.

Many thanks!
Riccardo

cg1_qlik
Contributor
Contributor

It works thank you

Regards

Malli

tester
Contributor
Contributor

is this not working anymore in QV 12.50 ?