Hello news.xb2.net,
Tell me, how do you do that ? , I mean Do you have app's with same way
> that I asked ?
I used to use the 'ghost' to init buffer vars, but have since implemented an automatic Object Relational Mapper (ORM) layer that lets me work with Classes instead of the database. The ORM uses the database schema to dynamically create persistent entity classes that automatically reflect the database. The ORM layer presents a NULL value to the UI very similar to dbSetNullValue().
I use ADS so that I can use 'workarea' style primary key seeks/recno updates/explicit row locking and SQL set based SELECTions and UPDATEs simultaneously. I track changes at the column level and detect edit collisions so that first write wins. I also support delta columns for numeric accumulation without collision. I allow multiple in-memory replica instances of a single entity and do not attempt to synchronize. For performance reasons, I use SQL cursors for browses since the ORM adds significant processing overhead and Xbase++ is not all that fast when many layers are involved.
More importantly, I standardized my UI on one 'FRAMESET' type layout with a handful of page types. The most common pages are menu, browse, (tabbed) edit, and crystal report. I don't attempt to use the browse for row editing since business apps tend to focus on a specific entity for editing.
My UI's are plain and simple so that I can focus the development resources on the processing model. I hope to someday allow the simplistic UI to serve both a WinApp and WebApp from a single source code. For now I focus on WinApps/WebServices and let HTML developers create WebApps against the Xbase++ process engine as desired.
In your example, my UI might allow the user to select an insert action while viewing a browse set which would instance a new entity class with membership in the set and open a edit page on it. Once saved or cancelled, I would return to the browse. Note that I try to stay within a single, fixed size, stationary (the user can move it, I don't) window for each user focus, but allow the user to popup a new window on page transitions when desired. Each window is treated as an independent user focus. I also try to avoid requiring mouse operations. The application is complete when all user focuses are closed and any background operations are finished/cancelled.
Because of the standardized UI, I have not needed the browse to present an empty row for insertion. If I did need an empty row, I would probably INSERT it in a transaction, refresh the browse, and commit on save/rollback on cancel.
ADS has a nice feature called AOF's which can implement dynamic rowsets pretty efficiently. If I was less invested in ADS, I would use SqlExpress to access Sql Server as my primary DBE.
Hope something here helps,
Rodd Graham, Consultant
Graham Automation Systems, LLC