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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CREATING NEW TABLE IN DATABASE THRU COLDFUSION ?

Status
Not open for further replies.

kingjjx

Programmer
Sep 18, 2001
181
0
0
US
Is there anyway I can let ColdFusion create a table in Access ?
Situation: I have 1 table that holds all employee names and each employee has his/her own table that contain his work hours. Is there anyway coldfusion can create an autmatic table for each new employee added to my Employee Table ?
I am using MS Access.

thanks
 
Something like this you need?

<cfquery datasource=&quot;YOUR_DATASOURCE&quot; name=&quot;create&quot;>
create table Emp_Name (Emp_Hours int null)
</cfquery>

Should be easy from there to make what you want.
 
I want to warn you, before you get too far along in developing your application, that your database design will probably cause you a lot of problems down the line. The idea of having a separate table for each employee is wrong, wrong, wrong. One of the fundamental concepts that you violate with that design is &quot;the database design should not need to be changed when the data changes.&quot; In your case, when a new employee arrives, you must create a new table. You should design the database so that you only need to add a new record to some table.

If this doesn't make sense to you, or if it does but you don't know how to redesign the database, write back.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top