Topic: protect edit buttom with password

hi
how can I protect an Edit-Buttom with password or

how can I create a user database with different permission levels
please a short example
thanks

Re: protect edit buttom with password

Hello,


Here you can download example, user with different permission levels
http://myvisualdatabase.com/forum/misc. … download=1


Also you can use script to protect edit button with a password

procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
begin
    If InputBox('Caption', 'Enter password', '')<>'123' then Cancel := True;
end;
Dmitry.

Re: protect edit buttom with password

Hi,
thanks a lot.
I'm not a programmer, but I begin to understand the software and I think it is fantastic. and your rapid assistance in the forum, super! remains so. amazing, thank you.
ps: how to write our own script? please books reference

Re: protect edit buttom with password

Hello Chiklopes

As MVD has been created from Delphi (RAD XE3), if you have some knowledge with Delphi language (Pascal), creations of script will be easy for you.
Otherwise, from numerous exemples delivered with MVD,  you can read all differents scripts to have an idea how to write a script (simp;e or more complex).
Good luck with it !

YY

Re: protect edit buttom with password

thanks yann.yvinec

Re: protect edit buttom with password

Hello
I tried to use your script in the example real estate but it did not work .... what did I do wrong? could help me understand the script
thanks
________

function CheckDublicate (Action, sTable, sField, sValue: string; id: integer;): boolean;
var
   s: string;
begin
     result := False;
     if Action = 'NewRecord' then
     begin
          s := SQLExecute ('SELECT Count(*) FROM '+sTable+' WHERE '+sField+' LIKE "' + sValue + '"');
          if StrToInt(s) > 0 then result := True;
     end;

     if Action = 'ShowRecord' then
     begin
          s := SQLExecute ('SELECT Count(*) FROM '+sTable+' WHERE ('+sField+' LIKE "' + sValue + '") AND (id <> '+ IntToStr(id) +')');
          if StrToInt(s) > 0 then result := True;
     end;
end;



procedure frmRealestate_Button2_OnClick (Sender: string; var Cancel: boolean);
begin
     if CheckDublicate(frmRealestate.dbAction, 'realestate', 'lastname', frmRealestate.edLastName.Text, frmRealestate.ButtonSave.dbGeneralTableId) AND
        CheckDublicate(frmRealestate.dbAction, 'realestate', 'firstname', frmRealestate.edFirstName.Text, frmRealestate.ButtonSave.dbGeneralTableId) then
     begin
          ShowMessage('Person already exists.');
          Cancel := True;
     end;
end;




begin

end.

Re: protect edit buttom with password

chiklopes
Please, send me your project to support@drive-software.com
I'll try to help you.

Dmitry.

Re: protect edit buttom with password

Dmitry,
I send you the project to your email
thanks

Re: protect edit buttom with password

Hello Dmitriy
I receive your email.
many thanks

Re: protect edit buttom with password

hello Dmitriy,
I sent you an email with the same project.
I made some changes to the file and it always gives me an error ... I need a little help how to solve it.
thank you

PS: have you other videos tutorial? it would be helpful.

Re: protect edit buttom with password

chiklopes
Hello, answered to e-mail )



Unfortunately there is no other videos tutorial.

Dmitry.

Re: protect edit buttom with password

Hello Dmitriy,
I received your email
thanks for the prompt reply as always