|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
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?" |
|
|
|
|
|
#2 |
|
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.
|
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 17:39.








Linear Mode
