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

HOw to create Database through cold fusion ?

Status
Not open for further replies.

tnsenthil

Programmer
May 11, 2002
5
IN
Hi!

I want to create an database in microsoft access through cold fusion program.If it is possible pls tell me how to create? and how to delete? a database using cold fusion.
 
i don't think that you are actually going to be able to create a database (.mdb file) by using Coldfusion alone.

i rememebr reading that someone had used cfobject to run microsoft classes that are installed with Access, to create the mdb file. Can't rememeber off the top of my head where i read this but will look around and see what i can find.

If you mean how do you create/delete a database table in access using coldfusion that is quite simple.

first you will need to create a datasource to a database on your server. lets call it dbSource

then make a coldfusion file that has got the following code in it

<!--- to create a table --->
<!--- put the field names and types (int, text etc) in the brackets below --->
<CFQUERY DATASOURCE=&quot;dbsource&quot;>
create table mynewtable (Field1 int ..... Field10 int)
</CFQUERY>

<!--- then to delete a database table --->
<CFQUERY DATASOURCE=&quot;dbsource&quot;>
drop table mynewtable
</CFQUERY>

put these two on seperate pages otherwise the table will be created and the dropped in the same process.

hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top