10 Replies Latest reply: Aug 11, 2014 5:27 PM by Massimo Grossi RSS

    Is there a way to drive the OLEDB connect statement by an IF statement and variable?

    Jake Kibler

      I modified a script of ours to try to dynamically pick a OLEDB connect string.  I created a spreadsheet that just has 1 value in it.  Either PROD or TEST.  I read the table based off of the spreadsheet and assign the value to a variable.  I then have the following IF statement:

       

      IF $(ServerEnv) = 'PROD' then

      //PROD

      OLEDB CONNECT32 TO [Provider=OraOLEDB.Oracle.1;Persist Security Info=False;User ID=wms_dw;Data Source=WMS_DWPROD;Extended Properties=""] (XPassword is PSWD);

      ELSEIF $(ServerEnv) = 'TEST' then

      //TEST

      OLEDB CONNECT32 TO [Provider=OraOLEDB.Oracle.1;Persist Security Info=False;User ID=wms_dw;Data Source=WMS_DWPROD;Extended Properties=""] (XPassword is PSWD);

       

      It runs and says successful but does not hit any of the code after this statement.  I did put a text object out on a page so that I could see it change between PROD and TEST and that works fine.

       

      Any ideas?