Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I'm refactoring a VB6 based application that compared if two Micorosft Access (.mdb) files were the same into C#. In the old vb6 code, a hex key was developed after reading each file and I believe the comparison between the hex keys. The vb code would iterate through each database using ADO and members such as RecordSet.

I've tried looking for examples of using ADO.net with C# with no success. Also if a new hex value must be used, the alogorithm for generating it must be FIPS 140-2 compliant. This application will not be reading the databases through the internet so I think SHA-1...256 would do or MD5. I've been told the Entity framework was a good possibility but I have not seen good coding examples to confirm if this is a good idea.

Does anyone have any suggestions with coding examples for how to iterate thru a .mdb file using C# plus developing a hex code once the iteration is done. Or is there a better solution using something else. Keep in mind that third party applications are not an option for me due to requirements that I've been given. Any help would greatly be appreciated.
Posted
Comments
George Jonsson 4-Apr-15 3:40am    
The easiest would probably be to read the whole file into a byte array and then calculate a hash value using either SHA or MD5.
Might take some time if the files are in sizes over 10 GB.
Mehdi Gholam 4-Apr-15 3:58am    
Compare how?

The easiest is to check the file sizes.
Member 11579826 6-Apr-15 11:44am    
I can't do a comparison based off the file sizes. The comparison must be based off the contents in each database.

Lots of ADO.NET samples to be found: https://www.google.com/search?q=ADO.net+with+C%23[^].
 
Share this answer
 
 
Share this answer
 
Comments
Member 11579826 6-Apr-15 11:41am    
When I build a desktop application based off the your suggestions, will the applications remember the schemas that were set?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900