1 (edited by kkalgidim 2016-11-18 15:39:24)

Topic: how can i modify error message for not null field

hi,

i want to make a field not null. so i click on not null box on database settings


when i try to save the field with nothing it gives me error as i wanted.
but i want to modify error message like "please enter a value"


now error message is :   "not null constraint failed ..."


i attached simple example about what i want

Post's attachments

Attachment icon notnullmessage.rar 2.03 kb, 371 downloads since 2016-11-18 

Re: how can i modify error message for not null field

i found solution from this topic
http://myvisualdatabase.com/forum/viewtopic.php?id=1985


procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
begin
    if Form1.Edit1.Text = '' then
    begin
        Cancel := True;
        ShowMessage('Your message here.');
    end;
end;