Solved

Determine the table field differences

Posted on 2012-03-20
9
333 Views
Last Modified: 2012-04-11
Looking for code to determine the differences between two tables' number of fields and which table does not have the certain fields.

I need to compare two tables between different databases and determine in variances in the number of fields and which tables/fields are different.

Looking for code to determine the differences?

K
0
Comment
Question by:Karen Schaefer
  • 5
  • 4
9 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37743842
You are not presenting a clear example of two different tables and the *exact* output you are expecting, ...
So creating a targeted solution is difficult...

See here:
http://www.fmsinc.com/microsoftaccess/databasecompare.html
...Why re-invent the wheel?

JeffCoachman
0
 

Author Comment

by:Karen Schaefer
ID: 37743873
Jeff

can't get FMS - company does not have license - can't buy one either.  Looking for freeware or shareware.

I have several databases versions of the same database where some of the older version's table structure has not been updated to include newer fields.  Trying to determine which version and tables contain these discrepancies and some how programically allow these differences in my latest version of the database.

Table1.PartnerID & table2 does not contain field for PartnerID.

If table 2 is different I need to change the record source for the form to create a temp field in my query for the Partner field so I do not get a missing object error.

any ideas?

K
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37743924
Again, please provide a more comprehensive example, and post the *exact* output you are seeking...
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:Karen Schaefer
ID: 37743966
I want to see which table contains the field PartnerID and which of the two tables don't - and if there is a difference the create a query to look like.

Table 1 - Select RecID, EmployeeName, PartnerID from table1
Table 2 = Select RecID, EmployeeName, "" as PartnerID from table2  

changing the record source for the data Entry form to "Select RecID, EmployeeName, "" as PartnerID from table2 "  etc.

I just want to identify which tables do not contain the same # of fields

So compare field count of Table 1 to Field Count of Table 2, if different, then determine which fields are missing from Table 2 and create a recordsource that allows for the missing fields.

Hope this helps you understand.

Since each of the older versions' table structure may have several missing fields.

K
0
 

Author Comment

by:Karen Schaefer
ID: 37743978
I can not change the actual older versions table structure I just want to bring in the older tables where applicable and handle any discrepancies that could cause the latest version of the database to display error messages for missing fields.

K
0
 

Author Comment

by:Karen Schaefer
ID: 37744002
As you probably know from previous post my database designs are not the most relationship oriented.  I have 100's copies of the the databases where the versions vary.  I can't change to a proper FE & BE situation.  I am stuck with what I have I just want to be able to push out the latest updates to ever version so I do not have multiple versions of the databases out there.  But in order to accomplish I need to be able to handle the variances in the table structures.  I have looked into version control, but still run into the differences in the actual structure issues.  The older databases are well into their life cycle and I cannot disrupted, trying to accomplish this task is humongous.

For the Partner detail info - some of the older versions will not have this type of data in their databases and this is just one example of the issues facing me.

K
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 37744077
As always, ...Anything is possible, ...but your request, (while straightforward), would be fairly time consuming to create from scratch. (For me at least)

Lets see if another Expert is willing to take this (or part of this) on...


JeffCoachman
0
 

Author Closing Comment

by:Karen Schaefer
ID: 37833791
Award points for time and effort
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37833926
No need...
Again, accepting a post for "Effort" will mark it as the "Solution"...
This will be confusing for others searching here for the same issue...

Just request that the Q be deleted...


Jeff
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now