StanP72
April 2nd, 2001, 03:23 PM
I am looking for a VB6 Add-in/ActiveX/Application that will allow me compare two tables and modify the second based on the first. Tables are the same name, just different databases. Functions like compare, delete fields, add fields, update fields. I will really appreciate anybody's input. Meanwhile I will create my own and post it later, but would like to know if anyone has done such thing in the past.
Thanx
Stan
Iouri
April 2nd, 2001, 03:36 PM
You can create 2 recordsets and compare them
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
iouri@hotsheet.com