CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> General/Other

 2 databases connections in 1 project and same page and same grid

Print topic Send  topic

Author Message
Jeferson
Posted: 09/02/2004, 12:39 PM

2 database connections in 1 project is ok(http://www.gotocode.com/art.asp?art_id=96&)

What about 2 databases connections on 1 page ? I use Oracle 8i and .NET (C#.NET) and i need to read some fields from my ERP System. In my grid i need to create a query with 2 connections.

I donīt want to create a view to solv this problem.

Do you have any ideia ?

Regards
Jeferson
DonB
Posted: 09/02/2004, 4:09 PM

If your goal is a join between tables in each connection, I'd say that's not
a very good idea. I'd always prefer the view if it was an option available
to me.

--
DonB

http://www.gotodon.com/ccbth
Mathias
Posted: 02/05/2005, 4:21 AM

Just create two database connections.
first open the first connection, initiate the while .. then in the while .. open and close the connection with the needed sql statement as needed.. ..

contact me if you need a code sample, I develop such things for a caq-software.
G Chalpati Rao
Posted: 02/15/2005, 11:58 PM

How can you connect to more than two databases simultaneusly using JDBC?
chrischunsi
Posted: 03/02/2005, 8:42 AM



Quote Mathias:
Just create two database connections.
first open the first connection, initiate the while .. then in the while .. open and close the connection with the needed sql statement as needed.. ..

contact me if you need a code sample, I develop such things for a caq-software.
Hey Mathias, any chance of the code example? I am having a similar problem with an ASP page, trying to do a joint from an AS400 database and an SQL database.

Thanks
RonB

Posts: 228
Posted: 03/02/2005, 10:07 AM

In php

Create a grid from a table in the first database. Lets say it holds a field called employee_id and all employee data is stored in a second database. You want the name for the employee in the second database to show in the grid that get's info from the first databae.

include the field holding the employee number in the grid and do a before show event on the label.

In the event code you do something like this:

$db2=new clsDBdatabase2();

$gridname->employee_id_field->setvalue(CCGetDBValue("select emp_name from employees where emp_nr=".$gridname->employee_id_field->GetValue(),$db2));

unset($db2);
$db2=new clsDBdatabase2();  
  
$gridname->employee_id_field->setvalue(CCGetDBValue("select emp_name from employees where emp_nr=".$gridname->employee_id_field->GetValue(),$db2));  
  
unset($db2); 

this will run a query to database 2 getting the employee name from the database and replaces the label in the grid with the employee name(be sure to set the label to text)

Ron
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.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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