Merging two MSHFlexGrids

10-13-2004, 01: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:

Smith;1234;customer 1
Clarke;3345;customer 2
Renard;4322;customer 3

Data retrieved from SQL-Server in MSHFlexGrid_2:


The third MSHFlexGrid3 shall contain both data as below:

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

10-14-2004, 08:41 AM

>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)

10-14-2004, 12:02 PM
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