2 Replies Latest reply on Feb 28, 2007 5:57 AM by BrainSan

    Multi database access in 1 component


      At the moment we're creating general components that look like the examples in the CF MX Bible book.
      In these components we've defined an application var that contains the database name, so the component could be used by multiple websites/application.cfc etc.
      These components are also created in a general folder with mappings redirecting to it.
      We're working with some webservices options with the same cfc, so we created a website with the home directory as our general cfc folder.

      This all looks fine and dandy, but let's say website A uses database B and website C uses database D, all nicely defined in the application.cfc of those websites.
      And let's say that we've created a webservice from the general cfc folder which checks addresses and returns the results, if website A and C needs them.
      The problem now is that the webservice website doesn't know the application var that contains the database name for website A or C.

      I know that the address webservice is not really a good example, since you usually just have 1 global address database for it, but there are certain situations where website A needs to call a webservice that checks a different database than website C.

      I've been thinking of a solution, but I just want to know if anyone has done this before or that they can share their idea about this.