Creating a new recordset by joining 2 existing recordsets 
Author Message
 Creating a new recordset by joining 2 existing recordsets

Maybe I am going about this the wrong way, but my issue is that I need
to process data from a DBaseII table into an SQL database. To do this, I
have created a recordset from the DBase table and another recordset(s)
from the SQL table(s). Not all of the records in the DB table are in the
SQL table but only the matching records are to be updated. OK, simple
enough so far.

I need to find matching records and do some processing on each record
before updating the SQL tables. Since I only have about 5000 records in
the DBase table, and only about 4000 will have a match in the SQL
tables, therefore I need to use:

rsSQL.Find "sqlItem= '" & rsDB!dbItem & "'"

If rsSQL doesn't have the rsDB item, then find takes excessive amounts
of time to complete (statistically around 5 seconds per find).

It would be better to create another instance of the recordset that is a
subset of the initial recordsets to ensure that only matching items are
inclusive.

Can I:
1. Create another recordset by joining 2 existing recordsets?
2. Create an initial recordset by joining a local DBase table with an
SQL table on an enterprise server?

Since you have read this entire, excessively lengthy, message, I welcome
your input and suggestions.

Excellence is achieved through 1% inspiration and 99% perspiration.

*** Sent via Developersdex http://www.*-*-*.com/ ***
Don't just participate in USENET...get rewarded for it!



Sun, 02 Jan 2005 20:13:37 GMT  
 Creating a new recordset by joining 2 existing recordsets
Hi,

You could do next thing

1. If you have PK field(s) in both databases, then you could select PK
values from SQL Server table and prepare next kind of SELECT statement to
select records from dBase table

SELECT * FROM MyTABLE WHERE PKField NOT IN (PUT here list of all PK values
from SQL Table) like

SELECT * FROm MyTable WHERE PKField NOT IN ('aaa', 'bbb',....)

In that case SELECT statement will select only records which do not match PK
values in SQL Server table.

2 Another way is to use SQL DTS. This tool comes with SQL Server and purpose
of it is to transfer data between different datasources.

--
Val Mazur
Microsoft MVP


Quote:
> Maybe I am going about this the wrong way, but my issue is that I need
> to process data from a DBaseII table into an SQL database. To do this, I
> have created a recordset from the DBase table and another recordset(s)
> from the SQL table(s). Not all of the records in the DB table are in the
> SQL table but only the matching records are to be updated. OK, simple
> enough so far.

> I need to find matching records and do some processing on each record
> before updating the SQL tables. Since I only have about 5000 records in
> the DBase table, and only about 4000 will have a match in the SQL
> tables, therefore I need to use:

> rsSQL.Find "sqlItem= '" & rsDB!dbItem & "'"

> If rsSQL doesn't have the rsDB item, then find takes excessive amounts
> of time to complete (statistically around 5 seconds per find).

> It would be better to create another instance of the recordset that is a
> subset of the initial recordsets to ensure that only matching items are
> inclusive.

> Can I:
> 1. Create another recordset by joining 2 existing recordsets?
> 2. Create an initial recordset by joining a local DBase table with an
> SQL table on an enterprise server?

> Since you have read this entire, excessively lengthy, message, I welcome
> your input and suggestions.

> Excellence is achieved through 1% inspiration and 99% perspiration.

> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



Sun, 02 Jan 2005 20:26:18 GMT  
 Creating a new recordset by joining 2 existing recordsets
Thanks for the quick responce, although the problems with this is in the
fine details. The connection strings required to access each database
are different and I cannot find a way to create a single recordset from
2 databases using 2 distinctly different connection strings.

As for using the DTS, I need an on the fly transposition of data. I
cannot do the data transfer to SQL and then runn the app from the new
table. I am trying to reduce time, not extend it. Obviously this would
be an easier way to handle the recordsets, but it is not feasible in
this case.

Thanks any way.

Excellence is achieved through 1% inspiration and 99% perspiration.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 02 Jan 2005 20:38:04 GMT  
 Creating a new recordset by joining 2 existing recordsets

Quote:
> Can I:
> 1. Create another recordset by joining 2 existing recordsets?

check out Shape-related topics in the ado manual.

Vadim



Tue, 04 Jan 2005 01:25:31 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Creating a new recordset from an existing recordset

2. Creating New SHAPE Recordset from Existing Recordset Object??

3. Creating a recordset from existing recordsets

4. How to create a Recordset from existing Recordset?

5. How to create a Recordset from existing Recordset?

6. How do I create a recordset based on an existing recordset

7. How do I create a recordset based on an existing recordset

8. How to create a Recordset from existing Recordset?

9. How do I create a recordset based on an existing recordset

10. Create a recordset from an existing recordset

11. Creating a new recordset from an existing one

12. HOW TO:Create a new recordset from an existing one

 

 
Powered by phpBB® Forum Software