Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In our company we are forced to change passwords every 90 days. So in my .qvw that generates my qvd's I don't want to have to go change my username and password for the ODBC connection for every single one every 90 days. Is there a way I can update one text file and then have all of my qvw's reference that one file for the username and password?
ODBC
CONNECT32 TO [EDW] (XUserId is right here is where I want it to point to an excel/text file, XPassword is right here is where I want it to point to an excel/text file);
Something like this (I'm using non-scrambled):
// Assuming it is Excel file with columns USERID and PASSWORD:
LoginData:
LOAD
USERID,
PASSWORD
FROM Data.xlsx (ooxml, embedded labels, table is Sheet1);
// Define variables:
LET vUser = peek('USERID');
LET vPassword = peek('PASSWORD');
// Don't need this table anymore:
DROP TABLE LoginData;
// Use variables in CONNECT
ODBC CONNECT TO [EDW] (UserId is $(vUser), Password is $(vPassword));
// DELETE these variables so they are not available in app front end:
LET vUser = null();
LET vPassword = null();
Regards,
Michael
Hi Neil,
you cannot point to a file inside the CONNECT statement but you could use variables which could be initialized from a file..
- Ralf
Yes, variables is a way to go. I guess you cannot use scrambled in this case.
Not without creating new CONNECT statement manuelly with new credentials and then store XUserId/XPassword into a file. But as I remember right there was a dll you could use to scramble with an external program..
Variables would be fine, but where would I assign what the variables are? It would have to be somewhere else so it can be one central location for all of my programs.
If it's not too much could you give an example snippet of code on how to do that?
Something like this (I'm using non-scrambled):
// Assuming it is Excel file with columns USERID and PASSWORD:
LoginData:
LOAD
USERID,
PASSWORD
FROM Data.xlsx (ooxml, embedded labels, table is Sheet1);
// Define variables:
LET vUser = peek('USERID');
LET vPassword = peek('PASSWORD');
// Don't need this table anymore:
DROP TABLE LoginData;
// Use variables in CONNECT
ODBC CONNECT TO [EDW] (UserId is $(vUser), Password is $(vPassword));
// DELETE these variables so they are not available in app front end:
LET vUser = null();
LET vPassword = null();
Regards,
Michael
hi,
This solution does not work in case of MySQL if I am also fetching DSN Name from excel.