7 Replies Latest reply: Apr 20, 2011 6:04 AM by Nathan Furbank RSS

    Loadscript to connect to 40+ separate ODBC connections (Loop and on at a time)

       

      Hello,

      I connect to about 40 different databases by ODBC.

      I use an Input box in my LOAD-script to set a variable with the correct number for each company but with 40 companies and more companies coming in I'm starting to have trouble to keep track of which company have the right number. Today the code looks like the one below and every new company gets a new ELSEIF.

      [CODE]

      LET vCompanynumber = input(' Companynumber: ', ' Company ');

      IF $(vCompanynumber)=01 THEN

      ODBC CONNECT TO [Company 1] (XUserId is cFVKFRBGQJMEWcdMHLAA, XPassword is ADBDIRFMOLYcWYIGIG);

      ELSEIF $(vCompanynumber)=02 THEN

      ODBC CONNECT TO [Company 2] (XUserId is SQfTFRBGRZNEWcdMHDDA, XPassword is YJUMNRFMOLYcWYIGCG);

      ENDIF

      [/CODE]

       

      I need help with 2 things:

      1. I would like to get a dropdown-list or something with each company number and name (I would prefer ODBC Connection name but it's not necessary) and with an easy click to start the loading. I only load data from one company each time with this application.

      2. For my second application I would like to load every company's settings and compare them. So I need a loop through all of the connections above.

      Note: I'm maybe over my head here because I have learned everything I know from programming in this forum the last 3 years so I would prefer some explanations if you post code here. [:)]

      Please help me.

      /Peter