Solved

Determine the table field differences

Posted on 2012-03-20
9
335 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
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…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

735 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