disconnect from a DB lazarus / 16-Databases ---------------------------------------------------------------------- Ati · 2006-08-19 07:42 Hello together, how can i really disconnect from a Firebird-DB. I used db.connected:=false but it seems that is this not right. ---------------------------------------------------------------------- Ati · 2006-08-21 07:44 Hello again, i want to give you more informations about the kind of problem i have. I have a login-form, where the user must give his user name (e.g. KLU) and his password. After Button-klick my app login as SYSDBA and get the ROLE. Then it should make a disconnect and connect again with usernam+pass+role. At the first it seem´s to be okay. But as i proof it with IBExpert i saw that the user logged in as SYSDBA?? So i think there is something wrong with my code. Here is my Code: Code: [Select]procedure TForm2.Button1Click(Sender: TObject); var user,rolle,pass:String; begin   user:=upcase(eduser.Text);   pass:=edpass.Text;   dm.qrlog.SQL.Text:='SELECT RDB$RELATION_NAME from RDB$USER_PRIVILEGES where (rdb$user_privileges.RDB$USER = '''+user+''') and (rdb$user_privileges.rdb$object_type=13)' ;   dm.qrlog.open;   label3.Caption:=dm.qrlog.FieldByName('RDB$RELATION_NAME').AsString;   rolle:=dm.qrlog.FieldByName('RDB$RELATION_NAME').AsString;   dm.dbmainlog.Connected:=false;   dm.dbmainlog.Close;   dm.dbmainlog.Open;   dm.dbmainlog.UserName:=user;   dm.dbmainlog.Password:=pass;   dm.dbmainlog.Role:=rolle;   dm.dbmainlog.Connected:=true;   showmessage('Eingeloggt als '+user);   Form1.ShowModal; end; procedure TForm2.FormCreate(Sender: TObject); begin   dm.dbmainlog.UserName:='SYSDBA';   dm.dbmainlog.Password:='masterkey';   dm.dbmainlog.Connected:=true; end; ---------------------------------------------------------------------- Ati · 2006-08-21 09:48 I have found an another way. I use for the login seperate db- components. After i get the ROLE i give the parameters to the main- components (all on a DataModul). But now i have the phenomenon that my program tell´s me that the table "test1" is unknown???