Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete class for parent/child
Message
From
08/05/1998 12:57:41
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
08/05/1998 12:42:36
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00098115
Message ID:
00098126
Views:
38
>>>Does anyone have or know of a delete button class which will allow me to delete child records of the parent? I realized (rather late I'm afraid) that the delete button I'm using assumes I want to delete for the master alias, and pays no attention to the children.
>>>
>>>I made things complicated for myself in that I was trying to use the same set of buttons at the bottom of the form and have them apply to my master table when I was on Page 1 of a page frame, and the child table when I'm on Page 2. The other parts seem to be working, but the delete is really insufficient.
>>>
>>>On the other hand, who needs to delete anyway;)
>>>
>>>Thanks,
>>>
>>>Sylvia
>>Sylvia,
>>Using referential integrity for database I think a button with only a custom property cAlias2OperateOn would be sufficient.
>>Cetin
>
>Cetin -
>Can you be more explicit about what should that button contain)?
>Sylvia
>P.S. When do you sleep <g>?
define class DeleteButton as commandbutton
cAlias2OperateOn = ""
procedure init
 if empty(this.cAlias2OperateOn)
    cAlias2OperateOn = alias()
 endif
endproc
procedure click
* Check editmode and Messagebox here for confirmation
..
 if lConfirmedDeletion
  delete in (this.cAlias2OperateOn) next 1
  tableupdate(0,.f.,cAlias2OperateOn)
* Or SQL delete
* Move rec pointer to a nondeleted if set del on
...
 endif
endproc
enddefine
I currently don't have a ready class for that so only the outline here.
P.S Would you believe if I say nights.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform