Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add new record in datawindowchild

Status
Not open for further replies.

Sjoker

Programmer
Aug 4, 2000
30
NL
In a datawindowchild I want to add a new record
which doesn't exist in the table it references.
How can I do this???
 
Try doing an embeddded SQL INSERT on the referenced table, then a refresh on the datawindowchild, or an InsertRow on the datawindowchild (not sure if that would work), assuming the datawindowchild's datawindow object is updateable.
 
DDDWs are generally lookup/reference tables undermining them. Usually, there will be data-entry screens to update/insert/delete the lookup/reference data. If you have one, you may update the lookup screen directly.

If you are sharing the DDDWs data from another source, you may insert a row in the Primary dw/ds that would show up in the DDDW.

If you are interested in inserting a row just on the fly in the DDDW without having to update the dB, do a GetChild() and then insert a row in the child-dw. Whether this would save data referenced on the main dw depends on the table constraints. If the DataObject attached to the DDDW is updateable, you can update the underlying table using the child-dw.Update().

As a last resort, you may do a raw INSERT into the table and refresh the DDDW.

---
PowerObject!
-----------------------------------------
PowerBuilder / PFC Developers' Group
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top