Hello, I have a question about datasources and a program that I am creating that I would appreciate a little advice on. This is an application in which about 5 different companies (to start with) will be using. The question is regarding how to use my datasource(s) wisest.
I have two choices that I am considering. I don't want to have 5 sets of the CF code, one for each company, instead I would like the code to change dynamically.
I could either
<b>A:</b> Have 5 different datasources and make the code that selects the datasource change dynamically to fit the companies individual records. (I set the datasource name to a default #request.dsn# in the application.cfm)
or
<b>B:</b> Have 1 datasource with a companyID in each of the tables and a master table that holds the company info such as it's name and ID #. Then in each SQL statement I create I would just pull up the information with a "where companyID = session.companyID" statement. (which would also be set in the application.cfm)
The database is currently being run on ACCESS but I plan to move it to SQL soon. I assume that each of the 5 companies will have about 400 records. Is there any way that records could get mixed up between companies if all the code was properly written? I am just not completely sure which method to use. Thanks a lot!!
Jimmy
I have two choices that I am considering. I don't want to have 5 sets of the CF code, one for each company, instead I would like the code to change dynamically.
I could either
<b>A:</b> Have 5 different datasources and make the code that selects the datasource change dynamically to fit the companies individual records. (I set the datasource name to a default #request.dsn# in the application.cfm)
or
<b>B:</b> Have 1 datasource with a companyID in each of the tables and a master table that holds the company info such as it's name and ID #. Then in each SQL statement I create I would just pull up the information with a "where companyID = session.companyID" statement. (which would also be set in the application.cfm)
The database is currently being run on ACCESS but I plan to move it to SQL soon. I assume that each of the 5 companies will have about 400 records. Is there any way that records could get mixed up between companies if all the code was properly written? I am just not completely sure which method to use. Thanks a lot!!
Jimmy