Merging two MSHFlexGrids

wendy
10-13-2004, 12:54 PM
I use three MSHFlexGrid in my project.

In the first MSHFlexGrid the user can load an Excel file.
The second MSHFlexGrid is populated with data of an external SQL server.

Data retrieved from Excel in MSHFlexGrid_1:

CUSTOMER_NAME;PART_NO;DESCRIPTION
Smith;1234;customer 1
Clarke;3345;customer 2
Renard;4322;customer 3



Data retrieved from SQL-Server in MSHFlexGrid_2:

CUSTOMER_NAME;ADDRESS;COMMTENS
Smith;City1;aaaa
Renard;City2;cccc


The third MSHFlexGrid3 shall contain both data as below:

CUSTOMER_NAME;ADDRESS;COMMTENS;PART_NO;DESCRIPTION
Smith;City1;aaaa;1234;customer 1
Clarke;;;3345;customer 2
Renard;City2;cccc;4322;customer 3


Currently I use a loop with .textmatrix(i,j) and copy the data from FlexGrid1 and FlexGrid2 into FlexGrid3.
This works in general but only if less data is stored in FlexGrid 1 or 2.
As soon as a large Excel file is loaded, or many data was retrieved from remote SQL server it takes a looooong time to add the data to FlexGrid3.

Is it possible to use a SQL query with JOIN instead?
Unfortunately I have no idea how to use it in this case :-(

Any hint are welcome.

Thanks / Stefan

Shurik12
10-14-2004, 07:41 AM
Hi,

>Is it possible to use a SQL query with JOIN instead?

I assume so, if the underlying tables can be joined, which implies that the data from the different sources is stored locally in one database (after all you could think of linking tables if the performance is not an issue for you)

wendy
10-14-2004, 11:02 AM
I found a good example to create a database by Flyguy.
I can now create a new database, but I don't know how to add the data to the database.

I suppose I can use two ways:

1) directly load the Excel or SQL-Server data in the local database. One table for the Excel data and one for the SQL-Server data.

2) Load the data into the MSHFlexGrid first (as I do it now). Then poplulate the database with MSHFlexGrid data later.

Unfortunately I don't know how to do this for both ways :-(

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum