[AccessD] Watching data

Gustav Brock gustav at cactus.dk
Sat Feb 28 09:31:14 CST 2004


Hi John

Well, one issue is speed.
Here's a link to a German guy, Jost Schwider, claiming some pretty
fast code: 

  http://vb-tec.de/crc.htm

What you'll need is the three top functions and this:

  http://vb-tec.de/bytelong.htm

You'll also need some helper functions like these:

<code>

Public Function Long2Chars( _
  ByVal lngCRC As Long) _
  As String
  
  ' Create four byte string from input value of type Long.

  Dim byt1  As Byte
  Dim byt2  As Byte
  Dim byt3  As Byte
  Dim byt4  As Byte
  
  Call Long2Bytes(lngCRC, byt1, byt2, byt3, byt4)
  
  Long2Chars = Chr(byt1) & Chr(byt2) & Chr(byt3) & Chr(byt4)
  
End Function

Public Function VerifyStringCRC32( _
  ByVal strText As String, _
  ByVal lngCRC As Long) _
  As Boolean
  
  ' Verify if CRC32 value of strText matches CRC32 check value lngCRC.

  Const clngLenCRC  As Long = 4
  
  Dim strCheck      As String
  Dim lngText       As Long
  
  lngText = Len(strText)
  strCheck = Space(lngText + clngLenCRC)
  Mid(strCheck, 1) = strText
  Mid(strCheck, 1 + lngText) = Long2Chars(lngCRC)
  
  VerifyStringCRC32 = CRC32Unicode(strCheck, True)
  
End Function

</code>


/gustav


> Hmmm, I like that idea.  I'll have to think about how to do that
> efficiently.

> John W. Colby
> www.ColbyConsulting.com

> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Gustav Brock
> Sent: Saturday, February 28, 2004 7:14 AM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Watching data


> Hi John

> I see. Then you could add a field with the original CRC value of the
> address. If the address is changed, a CRC check will fail.

> /gustav


>> Well... the data isn't normalized to that extent, i.e. I don't have an
>> "Address table".  A claimant has a single address, and that is embedded
>> directly in the Claimant table.  Thus a timestamp would only tell me that
>> the claimant table had changed, not that the address portion of the table
>> had changed.  Maybe she got married and changed her name?  The Date of Birth
>> was corrected?  The name was mis-spelled and the mis-spelling was corrected?

>> John W. Colby
>> www.ColbyConsulting.com

>> -----Original Message-----
>> From: accessd-bounces at databaseadvisors.com
>> [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Gustav Brock
>> Sent: Saturday, February 28, 2004 4:35 AM
>> To: Access Developers discussion and problem solving
>> Subject: Re: [AccessD] Watching data


>> Hi John

>> Wouldn't it be much easier to add timestamps and track these? If the
>> timestamp of an address is newer than that recorded for the case,
>> "something else" has changed the address.

>> /gustav


>>> I need a system for watching specific data fields in specific tables for
>>> changes.  For example, if the Policy holder address changes, the claimant
>>> address changes, the Payment location (address) changes etc.  If ANY of
>>> these change then I need to gather the information and at the end of the day
>>> email a report to the client (the insurance company) spelling out the
>>> changes, what object the fields belonged to (Claimant, Policy Holder etc.).




More information about the AccessD mailing list