2 Replies Latest reply: Aug 7, 2013 5:36 PM by Sree Anarasi RSS

    Connecting to database Dynamically

    Sree Anarasi

      Hi Folks,


      I  have 2 odbc connections one for production, Development.


      The entire script remains same  only i need to change the odbc connection depending on the computername or servername


      so i did like this but its not allowing me to do in the script and throwing an error.

      if i want to use the if condition in the script  how to add??



      IF(ComputerName()='ABC','ODBC CONNECT TO [xysbef;DBQ=xysbef] (XUserId is bJKfcYZODbXKXZVMSbXEXSFMETFA, XPassword is AJWSQYZODDZCGaFMRJIQL)',

      if(computername()='DEF','ODBC CONNECT TO [yeyeye;DBQ=yeyeye ] (XUserId is KTDBaYZODbXKXZVMSbXEXSFMEbeB, XPassword is eNUWRYZODDZCGaFMRJIAG)'));


      so when the computername is identified it should connect to that server odbc connection.