home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / database / ingres / 2191 < prev    next >
Encoding:
Text File  |  1993-01-08  |  2.2 KB  |  63 lines

  1. Newsgroups: comp.databases.ingres
  2. Path: sparky!uunet!tpghq!sfc
  3. From: sfc@tpghq.com (Steve Caswell)
  4. Subject: Re: ABF question
  5. Message-ID: <1993Jan8.143019.8886@tpghq.com>
  6. Organization: Palmer & Associates, Inc., Norcross, GA
  7. References: <1993Jan7.170744.71@ittpub.nl>
  8. Date: Fri, 8 Jan 1993 14:30:19 GMT
  9. Lines: 52
  10.  
  11. In article <1993Jan7.170744.71@ittpub.nl> hans@ittpub.nl writes:
  12. >I am using ABF to maintain a tabel of items. The user should be able to add 
  13. >and delete these items, and modify most of the information associated with
  14. >the item.
  15. >
  16. >Each items has a key value. I want to prevent the user from modifying this
  17. >key value. Defining the column DISPLAYONLY is no good, for the user has to be 
  18. >able to specify the value when adding new items. By the time I catch the error
  19. >I cannot change it back, as the original value is lost.
  20. >
  21. >Is there any way I can:
  22. >
  23. >a. Allow creation and deletion of a column in a table field, without also
  24. >   allowing modification?
  25. >b. Have access to the old value, so I can change it back?
  26.  
  27. You can only get access to the old value if you store that value when loading
  28. the tablefield.  You can accomplish this by adding a hidden column to the
  29. tablefield in the initialize section of the abf source:
  30.  
  31. initialize
  32. (table.hidden_column = datatype
  33. etc.
  34. )
  35.  
  36. and then load that column when you load the tablefield.  For example,
  37. table = select key_column
  38.               ,key_column as table.hidden_column
  39. etc.
  40.  
  41. >
  42. >Or is there any other way of doing what I want?
  43.  
  44. One solution we employ for this kind of problem is to leave the column in
  45. displayonly mode and keep the tablefield in update mode.  This allows only
  46. updating of rows loaded by the application.  To allow entry of new rows, we
  47. use an Add menuitem which displays a pop-up form to allow entry of new data
  48. values, then use insertrow or loadtable to add the new row to the tablefield
  49. from within the code.
  50.  
  51. >
  52. >Thanks in advance.
  53. >
  54. >Hans Wieldraaijer, ITT Publitec, Amsterdam, Netherlands.
  55. >E-mail: hans@ittpub.nl
  56.  
  57.  
  58. -- 
  59.  
  60. Steve Caswell           |   (404) 448-7727    |  "The opinions expressed are my
  61. Principal Consultant    |   sfc@tpghq.com     |   own.  They may not be perfect,
  62. The Palmer Group        |   uunet!tpghq!sfc   |   but they're all I've got."
  63.