szenczi
Posts: 67
|
| Posted: 01/08/2009, 3:45 AM |
|
Hi,
Can I make an application with multiple databases in which the user can choose his own database during the login process?
Thanks,
Norbert
_________________
CCS5.1, PhP, MySQL |
 |
 |
Gena
Posts: 591
|
| Posted: 01/08/2009, 4:03 AM |
|
I don't think this is possible using current CCS framework - you can't use/change Database runtime. And I see no reason why you need so. You can use one database, add some userID field into your tables - so you can easy filter information for current user...
_________________
Gena |
 |
 |
mentecky
Posts: 321
|
| Posted: 01/08/2009, 4:21 AM |
|
Norbert,
I have never tried it but if you edit Common.php and just after "//End Connection Settings" add some code you can change the database. For example:
$db = CCGetParam("database", "default");
$CCConnectionSettings['connection_name']['Database'] = $db;
I could be totally wrong but that's where I'd start.
Rick
_________________
http://www.ccselite.com |
 |
 |
szenczi
Posts: 67
|
| Posted: 01/08/2009, 4:28 AM |
|
Thanks Gena!
Unfortunately, I have the databases and the app already. In this case I must rebuild the databases into one and must change all pages of the application. (Originally it was built for one db.)
Norbert
_________________
CCS5.1, PhP, MySQL |
 |
 |
Gena
Posts: 591
|
| Posted: 01/08/2009, 4:33 AM |
|
Norbert, I see.
Btw you need to check your situation - what way is easy for you, also to support your project. I mean if tomorow you need to change your tables structure - you will need to make this changes in ALL databases... In case you have just one DB it's much more easy...
_________________
Gena |
 |
 |
szenczi
Posts: 67
|
| Posted: 01/08/2009, 4:42 AM |
|
Yes, quite so!
It would be good to use the existing app.
_________________
CCS5.1, PhP, MySQL |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 01/08/2009, 5:17 AM |
|
Hi
BTW. Rick's method in fact does work. I have used it to modify the parameters of the connection array.
But like Gena says. all the tables must be exactly the same between the 2 db's
Have fun
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
Vasiliy
Posts: 378
|
| Posted: 01/08/2009, 10:34 AM |
|
We use this approach - one web-app and multiple DBs.
DB is selected based on virtual directory (www.myapp.com/client1/, www.myapp.com/client2/).
You only need to change one line of CCS code - connection string.
Code that makes a distinction between DBs is in file Common.xxx, right after the connection string, and it overwrites the connection to the DB.
As for CCS, CCS with current functionality does not allow this.
_________________
Vasiliy |
 |
 |
Jan K. van Dalen
|
| Posted: 01/09/2009, 3:54 PM |
|
How about 1 database with filters according to login?
"szenczi" <szenczi@forum.codecharge> wrote in message
news:24965e7774d868@news.codecharge.com...
> Hi,
>
> Can I make an application with multiple databases in which the user can
> choose
> his own database during the login process?
>
> Thanks,
> Norbert
> _________________
> CCS4.01.00.06 PhP, MySQL
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>
|
|
|
 |
Oper
Posts: 1195
|
| Posted: 01/10/2009, 6:53 AM |
|
CCS actually doit without Common file change.
you dont need to change common.asp/php for this
use the Server Script connection during Design
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
Vasiliy
Posts: 378
|
| Posted: 01/10/2009, 4:20 PM |
|
> use the Server Script connection during Design
in asp I use w/o changing common.<ext>, in aspx had to change common.
_________________
Vasiliy |
 |
 |
szenczi
Posts: 67
|
| Posted: 01/11/2009, 1:03 AM |
|
Yes, this is one of the choices. A didn't decide yet.
Quote Jan K. van Dalen:
_________________
CCS5.1, PhP, MySQL |
 |
 |
szenczi
Posts: 67
|
| Posted: 01/11/2009, 1:22 AM |
|
In this case, how do I need to set the connection properties?
Thanks,
Norbert
Quote Oper:
CCS actually doit without Common file change.
you dont need to change common.asp/php for this
use the Server Script connection during Design
_________________
CCS5.1, PhP, MySQL |
 |
 |