Re: ADO Filtering and time
Have you thought about using Joins? I mean, to retrieve all data in one recordset and process them.
Vlad
Re: ADO Filtering and time
Have you considered opening a hierachical recordset using a shape command? When you do that you basically open two recordsets at the same time which are linked by an index that is created when you open the recordset. There's a parent recordset and a child recordset. You get all of the parents regardless of whether they have children or not It seems like the perfect construct for what you're trying to do. If you'd like to know more about it. Take a look at these links.
http://www.microsoft.com/mind/defaul...olumns0199.htm
http://www.vbpj.com/upload/free/feat...600/bf0600.asp
http://support.microsoft.com/support.../q196/0/29.asp
http://www.sqlmag.com/Articles/Index.cfm?ArticleID=5449
Hope this helps.
Re: ADO Filtering and time
That will compare 2 recordsets
Dim dbcurrent As Database
Dim qryMyQuery As QueryDef
Dim recMatching as Recordset
' Set the database
Set dbcurrent = OpenDatabase("c:\my files\myData.mdb")
'Create a Query
Set qryMyQuery = dbcurrent.CreateQueryDef(MyQuery, "SELECT * FROM [Tablename] WHERE [Exclusions]")
Your next move is to create a recordset based upon the matching criteria......
Set recMatching = dbcurrent.OpenRecordset("SELECT * FROM [Table2] INNER JOIN [MyQuery] ON [Table2].[common field] = [MyQuery].[Common Field]")
The recordset will now contain all the matching criteria that you will be able to manipulate in whatever
form you like.
Iouri Boutchkine
[email protected]
Re: ADO Filtering and time
Here are SQL's that give you everything in Table 1 what is not in table 2
I need all Customer ID in the Table T1 that are not in the table T2
SELECT DISTINCTROW [T1].[CustomerBPCSID], [T1].[ProgramNumber],
[T1].[RebateNumber]
FROM T1 LEFT JOIN T2 ON
[T1].[CustomerBPCSID] = [T2].[CustomerID]
WHERE ([T2].[CustomerID] Is Null);
'another way of doing it==================
This gives you all the records from table1 that are not in table2, and all the records from table2 that are not
in table1. However, you can't tell if those records were modified, added, or deleted. You can just see that
the have changed.
Note: this is 1 SQL statement, presuming that there are two tables (table1 and table2) which have
a two-columnd key (combinatin of field1 and field2)
SELECT * FROM table1 WHERE not(field1 in ( SELECT table1.field1 FROM table1
INNER JOIN table2 on table1.field1 = table2.field1 and tabel1.field2 = table2.field2)) AND not(field2 in
( SELECT table1.field1 FROM table1 INNER JOIN table2 on table1.field1 = table2.field1 and
tabel1.field2 = table2.field2))UNIONSELECT * FROM table2 WHERE not(field1 in
(SELECT table1.field1 FROM table1 INNER JOIN table2 on table1.field1 = table2.field1 and
tabel1.field2 = table2.field2)) AND not(field2 in ( SELECT table1.field1 FROM table1
INNER JOIN table2 on table1.field1 = table2.field1 and tabel1.field2 = table2.field2))
Iouri Boutchkine
[email protected]