Lazarus 1.6 & Firebird 3.0 lazarus / 16-Databases ---------------------------------------------------------------------- DeBritto · 2016-06-24 03:39 Hi folks, Someone has some information about Lazarus 1.6+FPC 3.0 running Firebird 3.0? I installed FB3 today and run my application but it doesn't connect to database. I'm using the native SQLdb component. Someone of you have information about the next Lazarus version or beta versions? ---------------------------------------------------------------------- LacaK · 2016-06-24 06:05 And can you connect to FB3 with any 3rd party tool ? I have used FB3 Embeded on Windows and it seems to me, that it works also with older versions of FPC and Lazarus ---------------------------------------------------------------------- talorigomat · 2016-06-25 06:08 I'm having the same problem.  When I connect using third party tools eg: dbworkbench it is okay.  When I try connecting with SQLDB it tells me my username and password are not defined. ---------------------------------------------------------------------- Zoran · 2016-06-25 07:46 Perhaps it is related to something described here: http://www.firebird sql.org/file/documentation/release_notes/html/en/3_0/rnfb30-security- new-authentication.html ---------------------------------------------------------------------- rvk · 2016-06-25 07:52 Quote from: DeBritto on June 24, 2016, 05:39:58 am... but it doesn't connect to database.Both TIBConnection and TSQLConnector work fine for me with Firebird 3.0 and Lazarus 1.6. What error are you getting? What username/password did you use (in 3.0 masterke might not work, note the absence of the y). ---------------------------------------------------------------------- talorigomat · 2016-06-25 14:09 I'm using user  name as sysdba and password as master key.   I had uninstalled firebird 2.5 before installing vs3 ---------------------------------------------------------------------- rvk · 2016-06-25 14:35 Quote from: talorigomat on June 25, 2016, 04:09:17 pmI'm using user  name as sysdba and password as master key.   I had uninstalled firebird 2.5 before installing vs3 It's SYSDBA (all caps) and masterkey (without a space). You didn't mention what error you got. ---------------------------------------------------------------------- talorigomat · 2016-06-25 14:55 The error I'm getting DoInternalConnect: 'your user name and password are not defined.  Ask your administrator to set up a Firebird login.   I'm using user name as SYSDBA  and password masterkey.   I had uninstalled Firebird 2.5 before installing Firebird 3 ---------------------------------------------------------------------- rvk · 2016-06-25 15:58 Did you skip the "enter new password" screen when installing Firebird 3.0? (you need to, to make sure the password and user is default) But if you can connect with the same user/password via dbworkbench that's strange. (or dbworkbench uses it's own embedded driver) Also... you can't connect to databases made in previous Firebird versions (yet). Did you create the DB with dbworkbench ? Can you check in dbworkbench what the ODS is of the DB created? ---------------------------------------------------------------------- talorigomat · 2016-06-25 16:00 Solved.  I uninstalled and then reinstalled firebird 3 (did it twice).  During setup when I typed the password in for SYSDBA as masterkey  I get an error when I try to connect in Lazarus. If I click though the setup without inputting the password as masterkey then I connect without a problem in Lazarus. ---------------------------------------------------------------------- rvk · 2016-06-25 16:08 Quote from: talorigomat on June 25, 2016, 06:00:57 pmDuring setup when I typed the password in for SYSDBA as masterkey  I get an error when I try to connect in Lazarus. If I click though the setup without inputting the password as masterkey then I connect without a problem in Lazarus.Strange. The first time I installed Firebird 3.0 I skipped the password page and it worked for me (and now for you too). But I had to try it, now, with putting in masterkey. So... just uninstalled it, removed the Firebird directory from program files (which was not entirely deleted) and installed again, inputting masterkey (with the y on the end). And... still all is wel with connecting to Firebird 3.0 from Lazarus. So I can't imagine what went wrong with your installation the first time... but it's solved now. ---------------------------------------------------------------------- talorigomat · 2016-06-25 16:40 It's a mystery to me too.  Thanks for the help ---------------------------------------------------------------------- laguna · 2016-06-29 07:15 How can I use the Embedded version? Which components can be used, the IBX are fine? Thank you all. ---------------------------------------------------------------------- rvk · 2016-06-29 08:25 Quote from: laguna on June 29, 2016, 09:15:50 amHow can I use the Embedded version? For Firebird 3.0: You can download the "Zip kit for manual/custom installs" and extract all files to you program directory. (note: download the correct bitness 32/64bit the same as your Lazarus version) It will use the fbclient.dll directly and see it needs to be the embedded version. I haven't found a way to copy the files to a subdirectory because they removed the RootDirectory option. For Firebird 2.5: You can download the "Embedded, separate download, zip kit." and extract it to your program directory. Please note that for testing purposes the server version is easier. You can distribute your working program with embeded later without change (if you keep the connect-string configurable). QuoteWhich components can be used, the IBX are fine? The standard SQLdb from Lazarus, IBX and ZeosLib all should work fine. ---------------------------------------------------------------------- DeBritto · 2016-06-30 00:41 Hi Folks, After many tentatives it's working! Firebird 3.0+Lazarus 1.6 (sqldb)+free pascal 3.0. I really dont't understod what happened. I installed FB3 many times, in the beginnig I was receiving some erros and Lazarus was crashing. But now, its working fine and I did not changed nothing in my app. ---------------------------------------------------------------------- mariodosreis · 2016-08-24 13:39 It work's fine here. Do you need an example? Bregards Mário ---------------------------------------------------------------------- regs · 2016-08-25 12:00 Have a question to those who migrated to FB3. Is there any ready quick solution to migrate smallint boolean domain (0,1) to native FB3 booleans? ---------------------------------------------------------------------- dogriz · 2016-11-21 15:19 Regarding this topic: I have Firebird 3.0.1 installed on Debian 64-bit system. I noticed that TIBConnection asks for libfbclient.so.2.5.1 library on Linux. (Lazarus fixes 1.6.3) When I symlinked it like this: Code: [Select]$ sudo ln -s /usr/lib/x86-64-linux- gnu/libfbclient.so.3.0.1 /usr/lib/x86_64-linux- gnu/libfbclient.so.2.5.1everything worked for Firebird 3. Where did that libfbclient.so.2.5.1 dependence come from? ---------------------------------------------------------------------- Zoran · 2016-11-22 13:01 It's in the very beginning of ibase60.inc - see: http://svn.freepascal .org/svn/fpc/tags/release_3_0_0/packages/ibase/src/ibase60.inc This should work for you - add this unit to your project: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit FirebirdLibraryLoad; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, sqldb, IBConnection; procedure SetFBLibPath(NewLibraryPath: String); implementation procedure SetFBLibPath(NewLibraryPath: String);var  LF: TLibraryLoadFunction;  UF: TLibraryUnLoadFunction;  OldLibraryPath: String;begin  OldLibraryPath := TIBConnectionDef.LoadedLibraryName;  if NewLibraryPath <> OldLibraryPath then begin     if FileExists(NewLibraryPath) then begin       if OldLibraryPath > '' then begin        UF := TIBConnectionDef.UnLoadFunction;        if Assigned(UF) then          UF();      end;       LF := TIBConnectionDef.LoadFunction;      if Assigned(LF) then begin        if NewLibraryPath <> '' then          LF(NewLibraryPath);       end;    end;  end;end; end.  Now, on your project start, call this function. Something like this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program project1; {$mode objfpc}{$H+} uses  {$IFDEF UNIX}{$IFDEF UseCThreads}  cthreads,  {$ENDIF}{$ENDIF}  Interfaces, // this includes the LCL widgetset  Forms, Unit1, FirebirdLibraryLoad  { you can add units after this }; {$R *.res} begin  RequireDerivedFormResource := True;   SetFBLibPath('/usr/lib/x86-64-linux-gnu/libfbclient.so.3.0.1');   Application.Initialize;  Application.CreateForm(TForm1, Form1);  Application.Run;end. ---------------------------------------------------------------------- abonic · 2016-11-27 16:29 Quote from: regs on August 25, 2016, 02:00:16 pmHave a question to those who migrated to FB3. Is there any ready quick solution to migrate smallint boolean domain (0,1) to native FB3 booleans? I would not rush with that. a) SqlDb (Lazarus 1.6.2) can't write native Boolean to Firebird 3 database (from DbGrid, at least). b) ZEOS (7.2.1-rc) can't even read FB3 native Boolean. The cause of the problem is trivial and I sent a fix to ZeosLib 7.2 Betatest Forum, but still can't see my topic there - apparently still awaiting approval by a moderator. My previous post on that strangely moderated forum did not show up even after several months, so I'll post the fix here: ZDbcInterbase6Utils.pas Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TZSQLDA.InitFields(Parameters: boolean);var  I: Integer;  SqlVar: PXSQLVAR;begin  {$R-}  for I := 0 to FXSQLDA.sqld - 1 do  begin    SqlVar := @FXSQLDA.SqlVar[I];    FDecribedLengthArray[i] := SqlVar.sqllen;    FDecribedScaleArray[i] := SqlVar.sqlscale;    FDecribedTypeArray[i] := SqlVar.sqltype;    case SqlVar.sqltype and (not 1) of                    { bug fix start }      SQL_BOOLEAN_FB,    { bux fix end }                SQL_BOOLEAN, SQL_TEXT, SQL_TYPE_DATE, SQL_TYPE_TIME, SQL_DATE,      SQL_BLOB, SQL_ARRAY, SQL_QUAD, SQL_SHORT,      SQL_LONG, SQL_INT64, SQL_DOUBLE, SQL_FLOAT, SQL_D_FLOAT:        IbReAlloc(SqlVar.sqldata, 0, Max(1, SqlVar.sqllen));      SQL_VARYING:        IbReAlloc(SqlVar.sqldata, 0, SqlVar.sqllen + 2)    end; ---------------------------------------------------------------------- Zoran · 2016-11-27 17:56 Quote from: abonic on November 27, 2016, 05:29:51 pmThe cause of the problem is trivial and I sent a fix to ZeosLib 7.2 Betatest Forum, but still can't see my topic there - apparently still awaiting approval by a moderator. My previous post on that strangely moderated forum did not show up even after several months, so I'll post the fix here: I reported this on their forum: http://zeoslib.sourceforge.net/viewtopic.php?f=40&t=62235 Let's hope moderators will react. ---------------------------------------------------------------------- LacaK · 2016-11-28 18:07 Quote from: abonic on November 27, 2016, 05:29:51 pm a) SqlDb (Lazarus 1.6.2) can't write native Boolean to Firebird 3 database (from DbGrid, at least). Lazarus 1.6.2 uses FPC 3.0.0 so there should be already support for Firebird 3 BOOLEAN data type. Do you get any error on Post ? ---------------------------------------------------------------------- marsupilami79 · 2016-11-28 18:35 Hello Zoran and abonic, the modification has been checked in to the SVN on sourceforge. The post was approved. With best regards, Jan ---------------------------------------------------------------------- abonic · 2016-11-28 20:31 Quote from: LacaK on November 28, 2016, 07:07:40 pmQuote from: abonic on November 27, 2016, 05:29:51 pm a) SqlDb (Lazarus 1.6.2) can't write native Boolean to Firebird 3 database (from DbGrid, at least). Lazarus 1.6.2 uses FPC 3.0.0 so there should be already support for Firebird 3 BOOLEAN data type. Do you get any error on Post ? I stand corrected - SqlDb in Lazarus 1.6.2 works without problems with FB3 native Boolean. Error was in my test project. Sorry for the misinformation. @Zoran, @marsupilami79 - thank you.