Solved

Row Hashing in Access 2010

Posted on 2014-03-18
9
495 Views
Last Modified: 2014-03-29
I want to create a hash from the contents of each row in a MS Access 2010 table.  The hash value will be used to de-dupe the content and to screen batch updates to the table.  I'm looking for something that could be plugged into the on_click event of a button, or made part of the update SQL statement.  I'm not a VBA programmer, so I'd like something very simple, or with an example that I could clone/repeat.
0
Comment
Question by:KBreedlove50
  • 5
  • 2
  • 2
9 Comments
 
LVL 35

Expert Comment

by:PatHartman
ID: 39938127
I don't see how the hash would help you.  It seems like adding an autonumber PK would have the same effect if you just want something to make the rows unique.
0
 

Author Comment

by:KBreedlove50
ID: 39938213
That won't tell me if the contents are unique.  That's why I want to hash the row contents and store the result IN the row to compare against new rows being uploaded from external sources.  I was able to do this with Access 2007, I believe, but that MD5 algorithm does not seem to be supported in Access 2010.
0
 
LVL 57
ID: 39938408
<<I believe, but that MD5 algorithm does not seem to be supported in Access 2010. >>

  No reason why not.  MD5 is not something built-in, but rather an add-on, and 2007/2010 are not all that different.

  If you have something working in A2007, it should work fine in 2010, unless you have the 64 bit edition of Office.   If you do, that just means you'd need to modify the calls for 64 bit (assuming your not accessing an external DLL).

Jim.
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

Author Comment

by:KBreedlove50
ID: 39938675
I'm pretty sure I was not accessing an external DLL, but I'll have to check.  I think that I tried it and it didn't work, but I'll have to go back to it and try again.  Thanks for the info.
0
 

Author Comment

by:KBreedlove50
ID: 39939299
I looked up what I had used in an Access 2003 or 2007 app and found this:

Private Sub cmd_Hash_Click()
    SourceHash = md5(Nz(SourcePath, "None"))
End Sub

I used the SourceHash line in a query in both Access 2007 and 2010 and got na "Undefined function MD5 in expression" error message.  I created a command button in a form, referencing an input field and got the same error message.

Unfortunately, it will be later today before I can access the app and confirm this is what I used.

Any more suggestions?
0
 
LVL 57
ID: 39939362
md5() is a function that is added to the database.

What it sounds like is that it's simply missing from your current DB or you may have broken references.

As I mentioned, the MD5 hash is not something built-in, but needs to be added.

Open the DB, compile it, and see what the problems are.

Jim.
0
 

Author Comment

by:KBreedlove50
ID: 39947750
I just tried it in another, Access 2013, DB and I got the same result.  Thanks for the help.
0
 
LVL 35

Accepted Solution

by:
PatHartman earned 500 total points
ID: 39948175
Search the A2007 database for a module that contains the MD5 function.  If you don't find it, you need to go back to the original database and check the references.  There may be a reference to a library database where that function is housed.
0
 

Author Closing Comment

by:KBreedlove50
ID: 39963716
thanks for all the help and advice.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Prime numbers are natural numbers greater than 1 that have only two divisors (the number itself and 1). By “divisible” we mean dividend % divisor = 0 (% indicates MODULAR. It gives the reminder of a division operation). We’ll follow multiple approac…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

840 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