Sometimes i have 2 identical tables but i need a simple means to compare whether these 2 tables are really identical just
to establish didnt i miss some field in them, and if some field is missing, wich one.
Is there such a function?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Compare 2 tables (Access 2000)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Compare 2 tables (Access 2000)
- This topic has 5 replies, 4 voices, and was last updated 20 years, 1 month ago.
AuthorTopicWSsvetljop
AskWoody LoungerApril 6, 2005 at 7:14 am #417968Viewing 0 reply threadsAuthorReplies-
WSHansV
AskWoody LoungerApril 6, 2005 at 7:42 am #939254Here is a procedure that will compare two tables and list the non-matching field names in the immediate window:
Sub CompareTables(strTable1 As String, strTable2 As String)
Dim dbs As DAO.Database
Dim tdf1 As DAO.TableDef
Dim tdf2 As DAO.TableDef
Dim fld1 As DAO.Field
Dim fld2 As DAO.FieldOn Error GoTo ErrHandler
Set dbs = CurrentDb
Set tdf1 = dbs.TableDefs(strTable1)
Set tdf2 = dbs.TableDefs(strTable2)On Error Resume Next
For Each fld1 In tdf1.Fields
Set fld2 = tdf2.Fields(fld1.Name)
If Not Err = 0 Then
Debug.Print fld1.Name & ” does not occur in ” & strTable2
End If
Err = 0
Next fld1For Each fld2 In tdf2.Fields
Set fld1 = tdf1.Fields(fld2.Name)
If Not Err = 0 Then
Debug.Print fld2.Name & ” does not occur in ” & strTable1
End If
Err = 0
Next fld2ExitHandler:
Set fld2 = Nothing
Set fld1 = Nothing
Set tdf2 = Nothing
Set tdf1 = Nothing
Set dbs = Nothing
Exit SubErrHandler:
MsgBox Err.Description, vbExclamation
Resume ExitHandler
End Sub
To compare two tables named Contacts1 and Contacts2, activate the Immediate window (Ctrl+G) and typeCompareTables “Contacts1”, “Contacts2”
then press Enter.
-
WSSupport4John
AskWoody LoungerApril 6, 2005 at 1:58 pm #939336 -
WSHansV
AskWoody Lounger -
WSSupport4John
AskWoody Lounger -
WSjacksonmacd
AskWoody LoungerApril 8, 2005 at 1:42 am #939734I have found MDBDiff to be invaluable for comparing the structures of two databases;
http://www.downlinx.com/proghtml/72/7220.htm%5B/url%5Dor
http://www.matpie.drw.net/PBSystems/produc…ed/MDBDiff.html%5B/url%5D
-
-
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
89 million Steam account details just got leaked,
by
Alex5723
4 hours, 9 minutes ago -
KB5058405: Linux – Windows dual boot SBAT bug, resolved with May 2025 update
by
Alex5723
4 hours, 17 minutes ago -
A Validation (were one needed) of Prudent Patching
by
Nibbled To Death By Ducks
4 hours, 26 minutes ago -
Master Patch Listing for May 13, 2025
by
Susan Bradley
4 hours, 59 minutes ago -
Installer program can’t read my registry
by
Peobody
5 hours, 32 minutes ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
17 hours, 47 minutes ago -
Intel : CVE-2024-45332, CVE-2024-43420, CVE-2025-20623
by
Alex5723
23 minutes ago -
False error message from eMClient
by
WSSebastian42
15 hours, 25 minutes ago -
Awoke to a rebooted Mac (crashed?)
by
rebop2020
1 day ago -
Office 2021 Perpetual for Mac
by
rebop2020
1 day, 1 hour ago -
AutoSave is for Microsoft, not for you
by
Will Fastie
1 hour, 30 minutes ago -
Difface : Reconstruction of 3D Human Facial Images from DNA Sequence
by
Alex5723
1 day, 5 hours ago -
Seven things we learned from WhatsApp vs. NSO Group spyware lawsuit
by
Alex5723
6 hours, 15 minutes ago -
Outdated Laptop
by
jdamkeene
1 day, 10 hours ago -
Updating Keepass2Android
by
CBFPD-Chief115
1 day, 16 hours ago -
Another big Microsoft layoff
by
Charlie
1 day, 15 hours ago -
PowerShell to detect NPU – Testers Needed
by
RetiredGeek
19 hours, 10 minutes ago -
May 2025 updates are out
by
Susan Bradley
8 hours, 47 minutes ago -
Windows 11 Insider Preview build 26200.5600 released to DEV
by
joep517
1 day, 21 hours ago -
Windows 11 Insider Preview build 26120.3964 (24H2) released to BETA
by
joep517
1 day, 21 hours ago -
Drivers suggested via Windows Update
by
Tex265
1 day, 21 hours ago -
Thunderbird release notes for 128 esr have disappeared
by
EricB
1 day, 19 hours ago -
CISA mutes own website, shifts routine cyber alerts to X, RSS, email
by
Nibbled To Death By Ducks
2 days, 4 hours ago -
Apple releases 18.5
by
Susan Bradley
1 day, 23 hours ago -
Fedora Linux 40 will go end of life for updates and support on 2025-05-13.
by
Alex5723
2 days, 6 hours ago -
How a new type of AI is helping police skirt facial recognition bans
by
Alex5723
2 days, 6 hours ago -
Windows 7 ISO /Windows 10 ISO
by
ECWS
15 hours, 7 minutes ago -
No HP software folders
by
fpefpe
2 days, 14 hours ago -
Which antivirus apps and VPNs are the most secure in 2025?
by
B. Livingston
1 day, 11 hours ago -
Stay connected anywhere
by
Peter Deegan
2 days, 19 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.