?
Solved

Row Hashing in Access 2010

Posted on 2014-03-18
9
Medium Priority
?
534 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 40

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 58
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 58
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 40

Accepted Solution

by:
PatHartman earned 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

809 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