Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

sibrulotte
Contributor III

GetClearPassword function

Hi,

I have my connection string that goes as follows:

LET STR_Connect = '[Provider=sqloledb;Data Source=$(SQLServerHostSecurite);Initial Catalog=$(SQLServerCatalogSecurite);User Id=$(SQLServerSecuriteUserId);Password=' & GetClearPassword('$(SQLServerSecuritePassword)', '$(CommonPath)') & ']';

CONNECT To $(STR_Connect);

Unfortunatly, the command line to retrieve the clear password does not execute, and Qlikview asks me for the clear password to connect to the DB.

my VB script to determine the function is as follows:

Function GetClearPassword(passw, currpath)

  strJava = """" & "java"" "

  strClassPath = " -cp " & """" & currpath & "\;"" "

   commandLineToExe=strJava & strClassPath & " HubizCryptoHelper -d " & passw

  

  Set objFileToWrite = CreateObject("Scripting.FileSystemObject").OpenTextFile("G:\Controle financier\SysFin\DEV_Qlikview\Finances GL\documents-tableaux-bord\logclear.txt",2,true)

objFileToWrite.WriteLine(commandLineToExe)

objFileToWrite.Close

Set objFileToWrite = Nothing

  GetClearPassword= ExecuteShellProgram(commandLineToExe)

 

End Function

As you can see, I write to a log to make sure I have the proper CommandLineToEXE, and I do. Whatever outputs from there, I paste to cmd, and I get my clear password.

But the function just does not execute itself like it used to, and I don't know what changed!!

3 Replies
sibrulotte
Contributor III

Re: GetClearPassword function

Update:

my collegue, sitting in front of me has no trouble reloading the exact same document.

MVP & Luminary
MVP & Luminary

Re: GetClearPassword function

Try executing the function from within the macro editor using the Test button. Create a testit sub and run that sub from the Test button.

Sub TestIt

     msgbox(GetClearPassword('xxx','yyy')

End Sub

It can be easier to debug this way.

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

sibrulotte
Contributor III

Re: GetClearPassword function

Good cue,

the function doesn't parse out correctly though. I'll try to figure out how to script it.

Thnaks Rob