dataset is inactive lazarus / 16-Databases ---------------------------------------------------------------------- Roque · 2014-10-15 15:29 previously i add a problem with mysql 5.5 / libmysql.dll couldn't be loaded  Some one told me to put  that dll in root of project folder .. it works only at run time .. but it work´s now .. can´t run a query the error says the dataset is inactive ...  it inactive because i can´t open/ active  de query I get the message that the query is closed  and get the inactive error on SQLQuery1.First;  procedure TForm1.Button1Click(Sender: TObject); var msg: String; erro :Boolean; begin   erro:=false;    msg:='ok ';   MySQLConn.Connected:=true;   if MySQLConn.Connected  then      SQLTransaction1.Active:=true   else   begin     erro:=true;     msg:='MySQLConn not connected .!';   end;   if erro=false then   begin       if SQLTransaction1.Active then         SQLQuery1.Active:=true       else       begin        erro:=true;        msg:='SQLTransaction1 not active .!';          end;   end;   if erro=false then   begin       if not SQLQuery1.Active then      begin       erro:=true;       msg:='SQLQuery1 not active ...!';      end;   end;   if (erro) then    MessageDlg('Error',msg ,mtError,[mbOK],0);    SQLQuery1.First; end;  thank you Roque ---------------------------------------------------------------------- Mike.Cornflake · 2014-10-15 17:16 Very odd.  Off the top of my head I cannot see any issue with your code... Only difference between the code I use and yours is that I use SQLQuery.Open instead of SQLQuery.Active:=True; I recently had this discussion about SQLTransaction.Active:=True verses SQLTransaction.StartTransaction, and was told then that they're the same. While the same is probably true about SQLQuery, make the change anyway, see what happens... Only other thing I can suggest is have a poke around in Lazarus with the Form Designer and Object INspector.  Have you got all your Objects linked together correctly? ---------------------------------------------------------------------- paweld · 2014-10-15 20:48 after the last IF statement, you must exit from procedure or insert SQLQuery1.First to the ELSE statement. or use TRY EXCEPT block: Code: [Select]procedure TForm1.Button1Click(Sender: TObject); var msg: String; begin   try     msg:='MySQLConn not connected .!';     MySQLConn.Connected:=true;     msg:='SQLTransaction1 not active .!';     SQLTransaction1.Active:=True;     msg:='SQLQuery1 not active ...!';     SQLQuery1.Active:=True;     SQLQuery1.First;   except     MessageDlg('Error', msg, mtError, [mbOK], 0);   end; end; ---------------------------------------------------------------------- Roque · 2014-10-17 12:48 ok , thank you .. but in what way your tip helps me with the current problem ?? ---------------------------------------------------------------------- Roque · 2014-10-17 12:50 thank you , "Only other thing I can suggest is have a poke around in Lazarus with the Form Designer and Object INspector.  Have you got all your Objects linked together correctly?" I will do that , thank you