Go Back   SitePoint Forums > Forum Index > Program Your Site > ColdFusion
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
Reply
 
Thread Tools Display Modes
Old Apr 29, 2009, 07:47   #1
xheartonfire43x
SitePoint Enthusiast
 
Join Date: Apr 2009
Location: Wallingford, CT
Posts: 91
Dynamically create a DB and add that DB as a datasource?

Hi all,
I am trying to build a CRM application that people can also sign up for a 30 day free trial of it. What happens is that people fill out a form, get an email, and then continue filling out the rest of their information. After the second form, I need to do two things. First I need to check to see if a DB exists that is called "CRE_#compName#_MemberData". Then if that DB does exist I need to then check to see if there is a DB called "CRE_#compName#_#managersLastName#_MemberData". If that exists then I will send an error message saying that they already have a trial. If it does not exist I need to then create the DB for them. So my first question is "Can you dynamically create an entire database if you have the SQL?" Then my second question that I don't think is possible is: "Can you dynamically add a datasource to the CF Admin?"
xheartonfire43x is offline   Reply With Quote
Old Apr 29, 2009, 08:52   #2
xheartonfire43x
SitePoint Enthusiast
 
Join Date: Apr 2009
Location: Wallingford, CT
Posts: 91
Okay I figured it out. I set my system Master DB as a datasource and then I use that for my queries. I first check the sys.databases table to check if a table exists and then I run everything. Rather than creating a datasource I just use the SQL USE command. It seems to be working pretty well.
xheartonfire43x is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 17:39.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved