Firebird database lazarus / 16-Databases ---------------------------------------------------------------------- finalist · 2009-10-25 21:43 I am absolutely beginner with Lazarus .... Please explain to me how to connect and work with Firebird database using a Lazaruz project. Wich components to use ? If I need 3-rd party components, please provide me links about to download these components. Thank you! ---------------------------------------------------------------------- clauslack · 2009-10-25 21:53 Here is an example of Firebird with Lazarus(SqlDb - need 3-rd party components). http://www.lazarus.freepascal.org/index.php/topic,7246.msg34315.html#m sg34315 In this forum there are a lot of info about Firebird - Lazarus (Sqldb, Zeos, etc) Regards ---------------------------------------------------------------------- finalist · 2009-10-25 22:24 Quote from: clauslack on October 25, 2009, 10:53:20 pmHere is an example of Firebird with Lazarus(SqlDb - need 3-rd party components). http://www.lazarus.freepascal.org/index.php/topic,7246.msg34315.html#m sg34315 In this forum there are a lot of info about Firebird - Lazarus (Sqldb, Zeos, etc) Regards Thank you very much !!!! I did change 3 lines in the example, and the SQL query into Memo1.Lines and it did open my table from my Firebird database !!! It works without any 3-rd party components .... ---------------------------------------------------------------------- clauslack · 2009-10-25 23:55 You right; sqldb come with FreePascal,  NO need 3-rd party components. Be carefull with this issue from SqlDb http://bugs.freepascal.org/view.php?id=12956 but you can make a couple of workarround. I use this with Linux and Windows, and works fine. Regards ---------------------------------------------------------------------- finalist · 2009-10-26 20:49 1. The example works under Windows XP Pro [32bit] and Firebird 2.1.3 [32bit]; 2. The example did not work under Windows 7 Pro [64bit] and Firebird 2.1.3 [64bit] - there is a message: Can not load default Firebird clients ("gds32.dll" or "fbclient.dll"). Check your installation. ---------------------------------------------------------------------- clauslack · 2009-10-26 21:06 In Windows 7 Pro [64bit] search the library fbclient.dll (from the installation of Firebird, or download from Firebird) and copy this to c:\windows\system32 (or your windows system directory) I believe the 32-bit version works on 64 bits. But there is also a 64-bit on the Firebird website.(I think) Another thing, is that the client fbclient.dll  uses the runtime Visual C 8, firebird has a MSI vccrt8_Win32.msi (msvcp80.dll,msvcr80.dll). But Windows 7 must have this runtime.(search for this) Check that and nothing more. Regards. ---------------------------------------------------------------------- finalist · 2009-10-26 22:59 I can not solve this, sorry .... I did copy a working example built under Win XP Pro 32bit into Win 7 Pro 64bit and it works fine. Bu I can not compile the same code under Win 7 Pro 64bit. I think there is a bug into 64bit version of component, I'm not sure but .... ---------------------------------------------------------------------- clauslack · 2009-10-26 23:17 Sorry I do not understand. The example works under Win 7 Pro 64bit? You install Lazarus under Win 7 Pro 64bit and not compile? What is exactly the errror? Look at this http://www.lazarus.freepascal.org/index.php/topic,7190.0.html ---------------------------------------------------------------------- finalist · 2009-10-27 06:28 I have 2 computers: 1. Laptop under Windows XP Pro [32 bits] - installed Lazarus [32 bits] and Firebird 1.6; 2. Desktop under Windows 7 Pro [64 bits] - installed Lazarus [64 bits] and Firebird 2.1; First I compiled the example on the Laptop and it was successful - i did change in example only the name of database, username and password, because these data was about another kind of database. I did change the SQL Query to open an existing table in my Firebird database. No more changes .... Aftef successful compilation and work of the example, I posted a comment into the forum, that it works o.k. Next day I decided to try out compilation by the Desktop computer. I did copy the source files there and did compile successful, but there was a message, when I did try to Run: Can not load default Firebird clients ("gds32.dll" or "fbclient.dll"). Check your installation. Then I did copy the cmpiled on the Laptop sql.exe and Firebird database from the Laptop to the Desktop computer - this works o.k on the Desktop. That's it. ---------------------------------------------------------------------- clauslack · 2009-10-27 11:38 And, the compiled in Desktop, run without the Lazarus IDE? Anyway. Can not load default Firebird clients ("gds32.dll" or "fbclient.dll"). Check your installation. Means - fbclient.dll does not exit (in the correct path, same directory o windows system directory) - fbclient.dll not load because there a missing requerid library (runtime Microsoft Visual Studio 2005-msvcp80.dll,msvcr80.dll) Check path, version of fbclient.dll and runtime Microsoft Visual Studio 2005 in Desktop. ---------------------------------------------------------------------- finalist · 2009-10-27 14:09 Compiled in Desktop sql.exe has the same message ... can not find "fbclient.dll" Compiled in Laptop sql.exe works fine - this application CAN FIND "fbclient.dll" My opinion is that Lazarus [64 bits] has a problem with Firebird 2.1.3 ---------------------------------------------------------------------- clauslack · 2009-10-27 14:35 Now I understand that, but in Desktop you found fbclient.dll? Check path, version of fbclient.dll and runtime Microsoft Visual Studio 2005 in Desktop. You can try in firebird site, for client fbclient.dll of windows 64 bits. ---------------------------------------------------------------------- finalist · 2009-10-27 14:54 Compiled in Desktop sql.exe has the same message ... can not load "fbclient.dll" in Desktop computer; Compiled in Laptop sql.exe works fine - this application CAN LOAD "fbclient.dll" in Desktop computer; I have installed Firebird-2.1.3.18185_0_Win32, now I will try in firebird site, for client fbclient.dll of Windows 64 bits. Thanks! ---------------------------------------------------------------------- clauslack · 2009-10-27 15:14 Forget the compiler. Forget Lazarus. The point is the missing fbclient.dll  (is not a Lazarus/fpc problem) in Desktop. Search in Windows Menu Find Files the fbclient.dll if found fbclient.dll - Check version (2.1,1.5,etc) - Check if 32 bits. - Check for (Microsoft Visual Studio 2005-msvcp80.dll,msvcr80.dll) Another easy check is: copy fbclient.dll,msvcp80.dll,msvcr80.dll in the same directory that sql.exe and run (without Lazarus) good luck... ---------------------------------------------------------------------- finalist · 2009-10-27 16:11 I have only: C:\Program Files (x86)\Firebird\Firebird_2_1\bin\fbclient.dll version 2.1.3.18185 and C:\Windows\System32\msvcp60.dll version 7.0.7600.16385 ---------------------------------------------------------------------- clauslack · 2009-10-27 16:34 Yes, the firebird client is not installed. Do it this (as administrador) - copy fbclient.dll to C:\Windows\System32 (windows system directory) - Run sql.exe (without Lazarus). - If not work install vccrt8_Win32.msi (come with Firebird Installer) - Run again sql.exe (should be work) Good Luck. ---------------------------------------------------------------------- finalist · 2009-10-27 18:47 There is something I don't understand: I run the 32 bits compiled sql.exe = it works fine after 5 seconds: I run the 64 bits compiled sql.exe = it does not work fine Is it possible to have installed firebird client for 32 bits compiled sql.exe after 5 seconds to have NOT installed firebird client for 64 bits compiled sql.exe ? ( I did download and did install some vccrt8_Win32.msi, but without success  ) Sorry, I give up about this problem ! ---------------------------------------------------------------------- clauslack · 2009-10-27 19:14 Do you install Lazarus of 64 bits? Try to use all 32 bits or all 64 bits, maybe mix 32bits and 64bits not work. About vccrt8_Win32.msi, sure must use 64 bits version.(if need) You can try a portable application, all of 32 bits of sql.exe and fbclient.dll in the same directory. But I don't have win64, so I can not check if this combination works Lazarus 32/64 + fbclient.dll 32/64 + vccrt8 32/64 Sorry... ---------------------------------------------------------------------- cdbc · 2009-10-27 20:21 Hi. According to Microsoft docs, win64 should run 32 bit apps without a hitch. Firebird has undergone a few changes lately, so you must make sure that you have the right 'fbclient.dll', that matches the server- version. At least that's what they say on their website. Regards Benny ---------------------------------------------------------------------- Vincent Snijders · 2009-10-28 08:55 win64 can run 32 bits application. But a 64 bits application application can only use 64 bits dlls. ---------------------------------------------------------------------- finalist · 2009-10-29 19:48 I understand now: Because it is installed Firebird 2.1.3 32 bits, sql.exe 64 bits does not work. There is no bug into Lazarus 64 bits, just if I find Firebird 64 bits, sql.exe 64 bits will be successful started. If anybody knows about Firebird 64 bits, please to share with me the link for download it .... Thanks! ---------------------------------------------------------------------- clauslack · 2009-10-29 23:59 Here is the link. http://sourceforge.net/projects/firebird/files/firebird- win64/2.1.3-Release/Firebird-2.1.3.18185_0_x64.exe/download Under http://www.firebirdsql.org/index.php?op=files&id=engine_213