Topic: Help in the _user table

Hi, I have added in the table  _user a  record with the name a1 which is a boolean type. So if the user name in the login Screen is correct then it should give a message box with the value of the record a1 . SoI use the script  to find the a1 value    y:=SQLExecute('Select a1 From _user where username = '+  onoma)  where onoma is the Application .User.Username and the a1 is the boolean. It doesn't work. Can someone help me?

Re: Help in the _user table

attach the project

Re: Help in the _user table

V_pozidis,


You mention that A1 is a boolean, did you declare Y as a boolean also?

On a clear disk you can seek forever

4 (edited by v_pozidis 2020-09-23 20:44:39)

Re: Help in the _user table

I will not attache the full software because it has to many forms. attach a sample . Please feel free to modify it to help me.
Thank you in advance

Post's attachments

Attachment icon a1.zip 326.62 kb, 210 downloads since 2020-09-23 

Re: Help in the _user table

var
onoma:string;




procedure Form1_OnShow (Sender: TObject; Action: string);
var
y:Boolean;
begin
   if Application.User.is_admin = true then begin
      onoma:=Application.User.Username;
      form1.Label1.Caption:= Application.User.Username;
      y:=StrToBool(SQLExecute('SELECT a1 FROM _user WHERE username="'+onoma+'"'));
      if (y=True) then  showmessage('yes and a1 has value ='+onoma) else showmessage('no');
   end;
end;
Post's attachments

Attachment icon a1.rar 4.51 kb, 195 downloads since 2020-09-24 

Re: Help in the _user table

sibprogsistem wrote:
var
onoma:string;




procedure Form1_OnShow (Sender: TObject; Action: string);
var
y:Boolean;
begin
   if Application.User.is_admin = true then begin
      onoma:=Application.User.Username;
      form1.Label1.Caption:= Application.User.Username;
      y:=StrToBool(SQLExecute('SELECT a1 FROM _user WHERE username="'+onoma+'"'));
      if (y=True) then  showmessage('yes and a1 has value ='+onoma) else showmessage('no');
   end;
end;

Thank your help