Transaction not Set lazarus / 16-Databases ---------------------------------------------------------------------- gkelby · 2014-02-26 07:58 Hello: I was hoping someone could help me with this simple problem.  I have a couple of forms and on any early form was able to query the database and extract the desired data and close the connection. On a subsequent form, with new DB controls and a DBGrid control I  try to read a table to select all values from that table in the same database to place into the DBGrid control on the form and I get a "Transaction not Set" error and it seems to occur at the "SQLQuery2.Open;" command. The datasource property of DBGrid1 is set to datasource2. The code sample is: Begin     SQLQuery2.Close;     SQLQuery2.SQL.Text := 'select * from Allowances';     SQLite3Connection2.Connected := True;     SQLTransaction2.Active := True;     SQLQuery2.Open; End Can anyone identify the problem based on the simple code example above? Your help would be greatly appreciated. Thanks... GK ---------------------------------------------------------------------- taazz · 2014-02-26 08:01 SQLQuery2.Transaction = ????? ---------------------------------------------------------------------- gkelby · 2014-02-27 05:31 Sorry, I should have included a few more details. Lazarus 1.1.99pre-release, FPC version 2.62, 32-bit package running on Win 7 64 bit and using sql3.dll. Sorry, I don't understand what you mean by "SQLQuery2.Transaction = ?????" GK ---------------------------------------------------------------------- taazz · 2014-02-27 05:59 sqlquery2 has a transaction property what is its value? If it is empty then add an TSQLTransaction link it to the connection and the SQLQuery2. ---------------------------------------------------------------------- gkelby · 2014-02-28 03:42 Thanks for the help. The transaction property was empty but when I set it to the TSQLTransaction link (in this case SQLTransaction2), it worked.  Lazarus usually or normally fills in that field with the Transaction property but this time, for some reason, it was empty. Thanks again for your help.  Greatly appreciated. GK.