Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datasource Advice

Status
Not open for further replies.

FastJimmy

Programmer
Jun 15, 2000
23
US
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 &quot;where companyID = session.companyID&quot; 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 think, based on what you've said, that option B is the best. Kevin
slanek@ssd.fsi.com
 
Thanks for your advice Kevin!! I have decided, after much thought, to choose the second method.

Jimmy
 
I think it would be best, as you would want to keep repetition at a minimum.

Make certain you put in the necessary safeguards to keep one company's info from being displayed to another company. Kevin
slanek@ssd.fsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top