Results 1 to 2 of 2

Thread: Log record save and delete

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Curtis Krauskopf Guest

    Default Log record save and delete

    The purpose of this module is to help a developer discover why records are
    being mysteriously deleted or overwritten. It does this by logging the key
    fields and other important information when a specific datafile is saved or
    deleted. This solution is only suitable for character-mode DataFlex.

    This solution falls under the category of "desperate times call for
    desperate measures". You really should only do this if you have exhausted
    every other avenue available to solve the problem. The good news is that
    every time I've used this technique, I've been able to find the problem as
    soon as a user caused the problem to occur.

    The overall scheme of this technique is to insert some code into an FMAC
    macro that saves and deletes records. The code will log each time a record
    is created or updated for a specific file. Because the code is inserted at
    the macro level, every source file, module, package, and include file
    anywhere in the application that uses SAVE, SAVERECORD and DELETE on the
    monitored file will have the transaction logged.

    This solution is compatible with every known technique for saving and
    deleting records:

    Save filename
    Save (integer)
    Save indirect_file.recnum
    SaveRecord filename
    SaveRecord (integer)
    SaveRecord indirect_file.recnum
    Delete filename
    Delete (integer)
    Delete indirect_file.recnum

    Other macros, such as the ENTER macro, will need to be slightly modified to
    log saves in those macros too. If none of your programs use an ENTER macro,
    then you can skip that part.

    This solution is designed to require a minimum number of changes to the
    source code. Three lines are required to be inserted at the top of each
    file. The lines are simple enough that a DataFlex program could be written
    to do this insertion, or if you're handy with PERL, AWK or your editor's
    macro language, you could use any of those techniques to insert those lines
    too.

    TDM_LOG.ZIP manifest:
    README.TXT
    TDM_LOG.DAT
    TDM_LOG.DEF
    TDM_LOG.FD
    TDM_LOG.HDR
    TDM_LOG.PKG
    TDM_LOG.TAG
    TESTING/T1.SRC
    TESTING/TEST1.DAT
    TESTING/TEST1.DEF
    TESTING/TEST1.FD
    TESTING/TEST1.HDR
    TESTING/TEST1.TAG

    Curtis Krauskopf
    The Database Managers, Inc.
    http://www.decompile.com




    Attached Files Attached Files

Similar Threads

  1. Delete record
    By Denis in forum Windows Applications
    Replies: 5
    Last Post: 3-Aug-2009, 08:42 AM
  2. can't delete record
    By DavidMartinko in forum AJAX Library
    Replies: 2
    Last Post: 10-Oct-2008, 08:37 AM
  3. removing the right click option 'save / delete' from a dbform
    By Simon Schoonens in forum Windows Applications
    Replies: 2
    Last Post: 11-Apr-2006, 06:52 PM
  4. Jump to next record after a delete
    By Katrien Naert in forum Windows Applications
    Replies: 1
    Last Post: 27-Jul-2005, 01:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •