CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 changeing connection parameters on the fly

Print topic Send  topic

Author Message
Gary Finlay
Posted: 02/13/2008, 11:11 AM

Hi,

Is it possible to specify connection parameters on the fly? I have a link
on a grid that when pressed shows another grid in a popup.

The grid on this popup screen is set up to use a separate connection and the
host and database name will always be different depending on the record
selected on the original grid.

Any ideas on how to do this?

mamboBROWN


Posts: 1713
Posted: 02/13/2008, 7:25 PM

Gary Finlay
Is there a set number of connections that you will have for this application?? I am not aware of a feature that allows you to change the CCS connections on the fly but I do know that you can definitely create a separate connection but exactly how do you plan to use that connection??
View profile  Send private message
Gary Finlay
Posted: 02/14/2008, 4:45 AM

I have my customers on grid_1.
On that grid is a link to grid_2.
Grid_2 should connect to my customer's table that is located on _their_
server.
So its at that point I need to set the connection parameters so grid_2 shows
the correct customer's data.

Each customer's data is on a different server (their own) and in a
differently named database.

The table I need to access within my customer's databases are similarly
named and have the same password assigned to that table (thus my need to
only change host and db name). The structure is identical in all cases.

I have all the required connection data with each customer.

So just to summarize I need to tell grid_2 where to get its data
_immediately_ before displaying.

mamboBROWN


Posts: 1713
Posted: 02/20/2008, 9:44 PM

Gary Finlay
I'll have an answer for you tomorrow...
View profile  Send private message
bestm80eva

Posts: 7
Posted: 03/13/2008, 3:30 AM

It cant be done the way you want it. what you will have to do is instead of a grid on your second form put a label. in the custom code section of the label chack your parameters and create a new grid based on it. (in code);you can use the html from the old second form as a help.

hope that helps

Dean
View profile  Send private message
feha


Posts: 712
Posted: 03/15/2008, 6:58 PM

Hi
You should try:
  
<?  
$CCConnectionSettings = array (  
    "cms" => array(  
        "Type" => "MySQL",  
        "DBLib" => "MySQL",  
        "Database" => "my_cms",  
        "Host" => "localhost",  
        "Port" => "",  
        "User" => "root",  
        "Password" => "",  
        "Encoding" => array("", "utf8"),  
        "Persistent" => true,  
        "DateFormat" => array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss"),  
        "BooleanFormat" => array(1, 0, ""),  
        "Uppercase" => false  
    )  
);  
?>  

make an include file ( config.php)
and put this code on it

edit your Common.php
put this right after : //End Connection Settings
  
//End Connection Settings  
if(file_exists(RelativePath ."/config.php") )  
{  
include_once(RelativePath ."/config.php");  
}  
your new connection array will overide the first one ...
than you can put some condition at
  
if(file_exists(RelativePath ."/config.php") && your condition here ... )  
if condition is met than your new connection will be included ...

note: the "cms" should be replaced with your connection name ...

this might not solve your complete problem but at least you can switch connections per condition


enjoy

_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.