Solved

Row Hashing in Access 2010

Posted on 2014-03-18
9
487 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 34

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
 

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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

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 34

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now