Excellently designed dialogs.
Now, instead of assigning your dialogs to oBrw:bEdit, you may assign to oRs:bEdit. oBrw:bEdit is inherited from oRs:bEdit by default. In this case you can use the same dialogs by calling oBrw:EditSource(.t./.f.) during browse and oRs:Edit(.t./.f.) when not browsing. We suggest not to edit oRs:Fields directly. This way you need never call oRs:appendblank(), which is primarily created for autoappend for inline editing in xbrowse.
Rowset object automatically takes care of data length and you need not do this check again at server-level.
You may also consider using stored procedures to handle data updates and inserts with data validation.
Primarily, you better use table design itself to implement as many integrity checks as possible. You are using MariaDB, which supports CHECK constraint which is not supported by MySql. (note: MySql does not raise error when CHECK constraint is specified but does not use it.)
- Code: Select all Expand view RUN
,age INT UNSIGNED CHECK ( age < 100 )
,_ ENUM ( 'Male', 'Female', 'Other', 'NotSpecified' )
Enum values are automatically shown with EditListBox in XBrowse and default edit dialogs.
User foreign key constraints and computed columns wherever appropriate.
Forcing upper/lower case:
Use COMMENT 'CASE:UPPER'
or COMMENT 'CASE:lower'
or COMMENT 'CASE:Proper'
while creating the table.
Rowset object forces the case specified while writing data.