Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 1st, 2005, 02:30 PM
Authorized User
 
Join Date: Jun 2004
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default comparing the designs of two mdbs

I am new to msaccess/vba.

To verify that the design of a given mdb matches a refernce mdb I tried to loop through the tabledefs and compare them.
However, I get a type mismatch error on the if statement:

dim tdfRef as tabledef, tdfTarget as tabledef
for each tdfRef...
  for each tdfTarget...
    if tdfRef=tdfTarget

Presuambly I'd need to compare indexes as well but the idea is stuck here.
1. Is there a way to do this comparison?
2. Is there a better way to do the design comparison.

I am not interested in comparing the data contents.
Thanks.

Tim
__________________
Tim
 
Old April 1st, 2005, 05:45 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

You cannot do this comparison directly. For this to work, there would have to be some value for the equality-comparison operator (the equal sign) to compare. What would the value of a tabldef be?

You are going to have to get the fields out of the one tabledef, then, using each field's name, retrieve that field from the other tabledef and see if they have the same type, size, etc.

Comparing databases is an arduous undertaking. . .
 
Old April 1st, 2005, 06:01 PM
Authorized User
 
Join Date: Jun 2004
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks.
tdf is afterall just a data-structure.
So by operator overloading this is easily possible had it been implemented.
Guess not in VBA.


Tim





Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing dates Tomi XSLT 1 September 21st, 2006 04:45 AM
Comparing 2 cols. Hudson40 Excel VBA 5 February 9th, 2005 03:27 PM
Help comparing dates Dave Brown Beginning PHP 3 December 20th, 2004 04:03 PM
Comparing DBNull rajanikrishna General .NET 1 December 10th, 2004 11:13 AM
Compact mdbs while open, using code Dwight Access VBA 4 September 8th, 2003 04:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.