5 Replies Latest reply: May 15, 2014 10:16 AM by MelaSarenas _ RSS

    Connect string password

    Andy Hewitt

      I'm working on a PreExport script where I pull data from an ORACLE database and write it to a csv file.   The connect sting includes variables for dbName, dbHost, dbUser and   

      dbPW.  Currently the variable are set in clear text prior to making the connection.

       

      The connection looks like this...

       

      conn1.open("Driver={Microsoft ODBC for Oracle}; CONNECTSTRING=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=" & dbHost & ")(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=" & dbName & "))); User Id=" & dbUser & ";Password=" & dbPW & ";")

       

      I'm trying to figure out how to use a password that isn't shown in clear text.

       

      I've looked through several threads but haven't found a solution. 

       

      Any Ideas?

       

      Thanks in advance.

        • Connect string password
          MelaSarenas _

          Hello DFASANDY,

           

          Haven't really tried this myself but there is a Password tab in the script editor of XPRJEditor.  I am thinking that you can define your passwords there and use that in your PreExport script. There should be a dbPW defined in the Passwords tab.   

           

          Mela

            • Connect string password
              Andy Hewitt

              thanks for the reply.  i've been working with the passwords tabs and can create one there.  But i haven't been able to figure out how to incorparte it into my script.   The only thing i've seenis an option to use it as a parameter for executing an external command.

                • Connect string password
                  MelaSarenas _

                  sorry for not responding immediately...

                   

                  you are right.  can't call the passwords defined in the passwords tab in a script.  passwords aren't hidden in our scripts as well (this i just realized). 

                   

                  sad to say i could not be of help.

                   

                  Mela

                    • Connect string password
                      Andy Hewitt

                      I was able to make the script work by using the following

                       

                      dbName = "some.server.com"

                      dbHost = "somehost"

                      dbUser = "userID"        

                      dbPW = Log.ExpandMacros("&[pwd.CIN12468PW]")

                       

                      constr = "Driver={Microsoft ODBC for Oracle}; CONNECTSTRING=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=" & dbHost & ")(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=" & dbName & "))); User Id=" & dbUser & ";Password=" & dbPW & ";"

                       

                      where dbPW is a variable used in the connect string and the CIN12468PW is a item created in the passwords tab in MDP.