Firebird 2.5 and Tsqlquery: problems lazarus / 16-Databases ---------------------------------------------------------------------- RayHall · 2010-11-05 15:34 The wiki contains a useful-looking article by Tom Bass (aka Bitzown) "Firebird in Action".  I am using Firebird 2.5 with a very recent download of Lazarus on Vista. The issue was (and is) that the component sets can run select statements but not insert or update.  Tom describes successful results from coding into the SQL.text property of the component but when I try this sort of thing I get Access Violation or other sorts of error and when I try to use the editors brought up via the property inspector, whether for SQL, InsertSQL or UPdateSQL the answer is "cannot open a non-select statement". This sounds rather definitive? The wiki article is dated 2006 and I wonder if it applied only to Firebird 1.1x, since this was compatible with Interbase 6. The result was that anything coded in the same way as the Borland compnents would happily work with Firebird but not with Fb2.x. Can anybody provide an authoritative answer here? If it is simply that nobody has the time or resources to update the Lazarus components that would be understandable. Nevertheless,  I would like to use Firebird (because I have used Interbase extensively in the past) and work entirely with Lazarus components, since going third party somehow seems to defeat the aim of the project. It is of course possible that I am still missing something, in which case please show me where I am going wrong. ---------------------------------------------------------------------- SteveF · 2010-11-05 16:05 There's another thread in this section which has links to video tutorials that use both Firebird and MySQL databases, including inserts, updates & deletes: http://www.lazarus.freepascal.org/index.php/topic,10172.msg50272.html# msg50272 The thread includes some code samples, but to cut to the chase, what seems to work is to use the TSQLTransaction component for these tasks.  The OP in the referenced thread built a universal procedure for this: procedure LaunchQuery(QueryObj:TSqlQuery;TransActionObj:TSqlTransactio n;StrSqlIn:string);   begin     TransActionObj.StartTransaction;     QueryObj.SQL.Clear;     QueryObj.SQL.Add(StrSqlIn);     QueryObj.ExecSQL;     TransActionObj.Commit;   end; The procedure is used by building the required SQL string in code, and passing it to the procedure like this: //Delete all records from the Firebird table   StrSql:=  'delete from testtab;';   LaunchQuery(SQLQuery1, Sqltransaction1, StrSql); Where SQLQuery1 & SQLtransaction1 are the respective query and transaction components linked to your Firebird TIBconnection component. For the purposes of the tutorial thread, this was done so that the same code & SQL could be used for either MySQL or Firebird, just by specifying different components in the procedure call.  If you're only using Firebird, this can be simplified but the basic process would be the same. Hope this helps, Steve (still learning all of this -- but the referenced thread was a big help!) ---------------------------------------------------------------------- RayHall · 2010-11-09 13:27 Thanks steveF, I will have a look at the tutorial but I suspect that it will be similar to previous offerings. There are significant differences between MySQL and Firebird and between the releases of Firebird. The early versions were  compatible with Interbase 6, so they all worked the same way and worked the same way as MySQL. Firebird 2.x was re- programmed and has interface differences. What I am after is an authoritative statement as to whether the TSQLquery component has been satisfactorily tested on FB2.5 or modified to cover glitches. I suspect neither but will go through the tutorial anyway ---------------------------------------------------------------------- SteveF · 2010-11-09 14:00 Ray, I haven't yet installed FB2.5, but I am using FB2.1 for my learning purposes.  The methods used in the referenced tutorial are working fine so far, but I haven't gotten into really complex SQL yet.  Simple Inserts, Updates, and Deletes work well and as expected, when run through the Transaction component. Steve ---------------------------------------------------------------------- José Mejuto · 2010-11-09 16:15 Quote from: RayHall on November 05, 2010, 04:34:01 pmThe wiki contains a useful-looking article by Tom Bass (aka Bitzown) "Firebird in Action".  I am using Firebird 2.5 with a very recent download of Lazarus on Vista. [...] Hello, I'm not using 2.5, but 2.1 work perfect. I'm using quite complex databases, extensive register references and some large fields and blobs.