Joe, Sorry I don't have a solution to your problem, but I'm hoping you can help me with my related one.
I tried using the code you posted and said worked. I was able to create a new MySQL database but when I went to drop and create a table Coldusion (MX 7) threw an error and said that the datasource I specified (which pointed to MySQL on the local machine without a database name specified) could not be found. However, I use the same datasource to create the database that I am using to try to create the table so that seems rather odd. I know that the dbname attribute that used to work in CF5 is now depricated. Do you know if any way around this so that I can create a database and tables and use it on the fly with going into the CF Administrator for each database? How did you specify your datasource "MyTSLLighting" in CF Adminsitrator to get this to work? Thanks for any help you can give, Kevin Hall > Hi, > I ran into a problem creating a mysql database with coldfusion. I'm > trying to create one cfquery to make a mysql database and create all > of the tables. When I do this Coldfusion throughs a "Syntax" error. > Any > thoughts on how I can combine the queries to make just one CFQUERY > call. I have listed my code below. > > --- Thanks > > <b>This Works:</b> > > <CFQUERY NAME="NEwDB" DATASOURCE="MyTSLLighting"> > CREATE DATABASE IF NOT EXISTS CandleFoot > > </CFQUERY> > > <CFQUERY NAME="NEwDB" DATASOURCE="MyTSLLighting"> > DROP TABLE IF EXISTS tblcalendarcolors > </CFQUERY> > > <CFQUERY NAME="NEwDB" DATASOURCE="MyTSLLighting"> > CREATE TABLE tblcalendarcolors ( > CalendarColorID int(11) NOT NULL auto_increment, > CalendarColor varchar(100) default '', > PRIMARY KEY (CalendarColorID) > ); > </CFQUERY> > > > > <b>This I can't get to work:</b> > > <CFQUERY NAME="NEwDB" DATASOURCE="MyTSLLighting"> > CREATE DATABASE IF NOT EXISTS CandleFoot > > DROP TABLE IF EXISTS tblcalendarcolors > > CREATE TABLE tblcalendarcolors ( > CalendarColorID int(11) NOT NULL auto_increment, > CalendarColor varchar(100) default '', > PRIMARY KEY (CalendarColorID) > ); </CFQUERY> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:6:2421 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/6 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:6 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.6 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
