borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (How to connect in Firebird??)Next Topic (Need Help Urgently !!) New Topic New Poll Post Reply
AndreaVB Forum : Database : Compiling SQL results into 1 report
Poster Message
Shady
Level: VB Guru


Registered: 08-07-2002
Posts: 305

icon Compiling SQL results into 1 report

First of all let me wish you all a very Merry Xmas and a Happy New Year.

Then let me pick your brains for my latest question.

Here's what I'd like to do.

I have 4 separate databases which contain customer information, is it possible to use SQL to find certain records (don't tell me how to match records with SQL I already got that question answered) and then move to the next data base to see if any records in that database match my criteria, and then the next database and so on.  After I have cycled through all the databases and found how many records match my criteria, is it then possible to compile all the search results in one DataGrid or FlexiGrid or whatever.

For instance:-

In DB1 I get:-

1. F.Bloggs - 32 High St

in DB2 I get:-

1. J.Bloggs - 7 New Road
2. D.Smith - 8 Station Road

and in DB3 I get :-

1. G.Brown - 1 The Manor

now is it possible to display these results as one list:-

1. F.Bloggs - 32 High St
2. J.Bloggs - 7 New Road
3. D.Smith - 8 Station Road
4. G.Brown - 1 The Manor

I would like to use the Data1 (DAO) method and implement this code via VB6 on an Access Database.

As always any information/code/ideas as how to accomplish this is much appreciated.

Regards

Shady

____________________________
I don't wanna die... but I ain't keen on livin' either

19-12-2002 at 11:15 AM
View Profile Send Email to User Show All Posts | Quote Reply
noycez
Level: VB Guru


Registered: 14-10-2002
Posts: 79
icon Re: Compiling SQL results into 1 report

using one recordset to get datas to different databases might not be possible (as far as i know) so as a suggestion, open one recordset for each databases.

to display in a datagrid may need a lot of work, you may use a dummy table where you save the results from the recordsets, the open another dummy recordset and get the data from the dummy table, and use this dummy recordset as a datasource for your datagrid. just dont't forget to empty the dummy database after you used it.

to display in a flexgrid, use AddItem of flexgrid's property and add all the datas from the recordset. the greater the data each recordset have, the greater the time it consumed.

hope this gives you an idea

____________________________
Funny thought:

Practice makes perfect.....
But nobody's perfect......
so why practice?

03-01-2003 at 02:18 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : Compiling SQL results into 1 report
Previous Topic (How to connect in Firebird??)Next Topic (Need Help Urgently !!) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder