Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing Database

Status
Not open for further replies.

LeonTang

Technical User
Mar 26, 2001
340
SG
Hi,

Is there anyway that I can compare 2 database in visual basic? That means checking for the same table names and column names within each table. Btw, I am using DAO.

Thanks for your time,
Leon If you need additional help, you can email to me at zaoliang@hotmail.com I don't guaranty that I will be able to solve your problems but I will try my best :)
 
There are probably many ways.
You can create two ODBC connections to the different databases.

Retrieve a recordset from both and compare the results of the resordsets. e.g
conOne.open "firstODBC","signin"
conTwo.open "secondODBS,"signin"
set rstOne=conOne.execute("selext yourColumn from yourTable")
set rstTwo=conTwo.execute("selext yourColumn from yourTable")
Then you can easily compare the results by using
rstOne!yourColumn=rstTwo!yourColumn
KR/Anette
 
Thanks for your reply. But that wasn't actually what I was looking for...

I know that I can loop through the tables within the database and inturn loop through the columns within the tables. But are there any shortcut to it?

Perhaps something like comparing the tabledefs of the 2 database?

Thanks again,
Leon
If you need additional help, you can email to me at zaoliang@hotmail.com I don't guaranty that I will be able to solve your problems but I will try my best :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top