RE: Need ideas about comparing old and new values

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Charles (anonymous_at_discussions.microsoft.com)
Date: 03/24/04


Date: Wed, 24 Mar 2004 12:01:15 -0800

Well, this is what I am getting so far. Any input would be helpful. Thanks.

Private Function TestCompare(ByVal org As Object, ByVal [new] As Object) As DataTable
        Dim sOrg As String
        Dim sNew As String

        Dim fis As PropertyInfo() = org.GetType.GetProperties
        For Each fi As PropertyInfo In fis

            sOrg = org.GetType.InvokeMember(fi.Name.ToString(), BindingFlags.GetProperty, Nothing, org, Nothing)
            sNew = [new].GetType.InvokeMember(fi.Name.ToString(), BindingFlags.GetProperty, Nothing, [new], Nothing)

            If sOrg <> sNew Then
                Debug.WriteLine(sOrg & " " & sNew & " " & fi.Name.ToString)
            End If
        Next

    End Function

     
     ----- Charles wrote: -----
     
     I have a webform that would display an employee's contact information (address, phone, and etc). This data comes from a class (CEmployee) that accesses a database. The employee can change their address on this form.
     
     I would like to get some (good) ideas on how I could tell what information has been changed. For example, they change their street address. I want to make something that would tell me that someone changed their address. If I can I would like to have it return a datatable for other processing (store the change in the database).
     
     Thanks for any ideas!
     Charles
     



Relevant Pages

  • Re: Code Clarity - Comments Invited
    ... matched data from the Employee Master File) into output which is then sent ... SSN input was the easier since the ... Employee Master has an SSN key; for Org input I would process the Master ...
    (comp.lang.cobol)
  • Re: dlookup formula in Form
    ... It may be a design issue. ... Form is a query of a Master Employee table. ... contains Org Name and Org Number and a Control Org Table also contains Org ...
    (microsoft.public.access.formscoding)
  • database class
    ... What do you think about this database class? ... between servers - the more numbers, the more work for the master ... private function getUpdateQuery{ ... // runs any update query and returns the newly inserted row ID ...
    (comp.lang.php)
  • Sub-Report Caculation question
    ... Add this query as a data source into your existing query, ... linking by employee. ... >The detail section shows more info about each Org, ... Problem is i keep getting totals for ...
    (microsoft.public.access.reports)
  • Re: Clean Up After DAO "Connection"?
    ... > strMyTempDbs As String ... > Private Function fncCreateTempDatabase(strMyTempDbs As Database) ... String variable -- to these last two functions? ...
    (microsoft.public.access.modulesdaovba)