CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> Archive -> GotoCode Archive

 CCS - Dynamic SQL Databases

Print topic Send  topic

Author Message
Steve
Posted: 09/27/2002, 8:49 AM

I have 2 web applications (one in ASP and One in ColdFusion) that has a primary SQL Server Database (contains Client and Business info) and a User/Application Database (Broken Down By Regions). Databases are SQL Server Databases.

The associated User/Application Database can be derived from the Primary Database from the associated Client record.

I have ClientMain List/Maint pages (From the Primary Database DSNPrimary). From the ClientMain List/Main pages, I want to link to a ClientData Page which shows information from the associated secondary Database (DSNRegX where X represents the associated Clients Region).

So the CCS Project will have a Primary Connection (DSNPrimary) and a Secondary Connection (DSNReg1, DSNReg2, etc...).

My Question:

How do you make a page's/form's Connection Dynamic based on a passed parameter? The passed parameter can be the client id or the associated region.

I have both an ASP Project and a ColdFusion Project that will need a methodolgy for dynamicaly setting the Secondary Connection appropriately.

I am thinking that the pages before show event can resolve the client id/region, which will determine the Region for the Secondary Database determination. At that point the forms Connection string would need to be changed?

I'm not sure on the exact methodolgy that would need to be used for CCS ASP and Cold Fusion.

Any help? Methodolgies?





Nicole
Posted: 10/01/2002, 5:26 AM

Steve,
here is a tip for ASP. You should create connection for the page on the fly depending on passed parameter (or something like this). To do it modify the code like below in the <page_name>.asp file

'Initialize Objects @1-E2F5B831
Set DB<connection_name> = New clsDB<connection_name>

to
'Initialize Objects @1-E2F5B831
if conedition then
Set DB<connection_name1> = New clsDB<connection_name1>
else
Set DB<connection_name1> = New clsDB<connection_name2>

end if


Or create Page After Initialize event:
Set DB<connection_name1> = New clsDB<connection_name23>

Note that all connections you want to use should exist in the project

   


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.