Recent

Author Topic: Wich from LCL to use for work with Firebird  (Read 21434 times)

finalist

  • Jr. Member
  • **
  • Posts: 99
Wich from LCL to use for work with Firebird
« on: April 08, 2011, 07:26:16 am »
I would like to work with Firebird Database.
Wich components to use ?
Thank you !

hallenberger

  • New Member
  • *
  • Posts: 43
Re: Wich from LCL to use for work with Firebird
« Reply #1 on: April 08, 2011, 08:09:05 am »
Hello!

I use the uib-components in Lazarus and Delphi. Works fine.

http://www.progdigy.com/?page_id=5
Debian/Sparky Linux
OS: Windows XP
Lazarus: with fpcupdeluxe

Arbee

  • Full Member
  • ***
  • Posts: 223
Re: Wich from LCL to use for work with Firebird
« Reply #2 on: April 08, 2011, 09:19:29 pm »
The SQLDB component works fine with Firebird.  Comes bundled with Lazarus, although I think it is not pre-installed.

The free ZEOS package works too.  If you're using FB 2.5 then you should use the 7.0.0 release in that case.  FB2.1 and earlier work with versions 7.0.0 and 6.6.
1.0/2.6.0  XP SP3 & OS X 10.6.8

finalist

  • Jr. Member
  • **
  • Posts: 99
Re: Wich from LCL to use for work with Firebird
« Reply #3 on: April 09, 2011, 08:16:26 am »
Thank you.
I see, there are SQLdb and Zeos Access components, waiting for me to use them :)
Everithing will be o.k. I suppose.

finalist

  • Jr. Member
  • **
  • Posts: 99
Re: Wich from LCL to use for work with Firebird
« Reply #4 on: April 09, 2011, 11:49:24 pm »
At Design-Time:
1. IBConnection, fill-up the properties
IBConnection.Connected := True; - I see it is True
2. SQLTransaction.Active := True; - ( Automatic is True )
Problem:
3. SQLQuery.Active := True; - but it does not become as True (becomes back as False)
DeleteSQL := 'DELETE FROM PLAYERS WHERE PLAYER = :PLAYER';
InsertSQL := 'INSERT INTO PLAYERS VALUES
(:PLAYER,
 :TEAM,
 :FROM_YEAR,
 :TO_YEAR,
 :MATCHES,
 :GOALS)';
UpdateSQL := 'UPDATE PLAYERS SET
(TEAM = :TEAM,
 FROM_YEAR = :FROM_YEAR,
 TO_YEAR = :TO_YEAR,
 MATCHES = :MATCHES,
 GOALS = :GOALS)
WHERE PLAYER = :PLAYER';
I don't understand the reason for that behavior.
Can anybody help me about this problem ?
Thank you !

Zoran

  • Hero Member
  • *****
  • Posts: 1830
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Wich from LCL to use for work with Firebird
« Reply #5 on: April 10, 2011, 06:37:59 am »
I assume that in SQL property you have "SELECT * FROM PLAYERS".

First, does it work if you remove code from DeleteSQL, InsertSQL and UpdateSQL properties? Can you set SQLQuery.Active?

finalist

  • Jr. Member
  • **
  • Posts: 99
Re: Wich from LCL to use for work with Firebird
« Reply #6 on: April 10, 2011, 08:14:01 am »
SQL is set to "SELECT * FROM PLAYERS"
I Can not set SQLQuery.Active to True;

After I removed code from DeleteSQL, InsertSQL and UpdateSQL properties, SQLQuery.Active can not be set to True.

( I can open Database using IBExpert, I can see data into Table PLAYERS, I can see information about Database is Server version 2.1 (Firebird) )
« Last Edit: April 11, 2011, 03:44:04 pm by finalist »

Arbee

  • Full Member
  • ***
  • Posts: 223
Re: Wich from LCL to use for work with Firebird
« Reply #7 on: April 11, 2011, 03:11:16 pm »
You don't get any error message when you try to open the query?

have you tried doing it programmatically (like coding a "SQLQUERY.OPEN" in - for instance - the form's onCreate event).  No error then?

By the way ... what platform and Lazarus/FPC are we talking here?
1.0/2.6.0  XP SP3 & OS X 10.6.8

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11452
  • FPC developer.
Re: Wich from LCL to use for work with Firebird
« Reply #8 on: April 11, 2011, 03:29:38 pm »
Did you copy the FB client DLL to the application directory?

finalist

  • Jr. Member
  • **
  • Posts: 99
Re: Wich from LCL to use for work with Firebird
« Reply #9 on: April 11, 2011, 04:22:08 pm »
I don't get any error message when I try to open the query.
I tried doing it programmatically by:
Code: [Select]
procedure TForm_Firebird.FormCreate(Sender: TObject);
begin
  DBFolder := ExtractFilePath(Application.ExeName) + 'DB';

  IBConnection.DatabaseName := DBFolder + '\SCORERERS.FDB';
  Edit.Text := DBFolder + '\SCORERERS.FDB';
  IBConnection.HostName := '';  // 'localhost';
  IBConnection.UserName := 'SYSDBA';
  IBConnection.Password := 'masterkey';
  IBConnection.Connected := True;
  SQLQuery.Active := True;
  (*
  ZConnection.Database := DBFolder + '\SCORERERS.FDB';
  ZConnection.HostName := '';
  ZConnection.User := 'SYSDBA';
  ZConnection.Password := 'masterkey';
  ZConnection.Connected := True;
  *)
end;
The behavior I describe is under 64 bits Windows 7.
I have installed Code Typhon Center ver.1.20 for Win64, but I have 2  options:
1. Lazarus for Win64;
2. Lazarus for Win32 (Active) ver.0.9.29;
I have Free Pascal ver.1.0.12 2010.12.30;
Both are installed under Code Typhon.
The reason I did install Code Typhon is, I could not install Lazarus under Windows 7 ( at the end of 2010 year ).

( I have 32 bits Windows XP installed on another partition on the same PC. Yesterday I did try to compile and start without success the same programm code, there was error message, but I forgot it ).

I did not copy the FB client DLL to the application directory, I did copy it to the Database directory ( may be it is my mistake ).
« Last Edit: April 11, 2011, 04:35:48 pm by finalist »

Arbee

  • Full Member
  • ***
  • Posts: 223
Re: Wich from LCL to use for work with Firebird
« Reply #10 on: April 11, 2011, 06:03:05 pm »
You are using FB embedded by the looks of it?

Have you also tried storing the DLL in the Windows directory?
(I guess it still exists in W7 ... personally I still trail behind on XP)
1.0/2.6.0  XP SP3 & OS X 10.6.8

finalist

  • Jr. Member
  • **
  • Posts: 99
Re: Wich from LCL to use for work with Firebird
« Reply #11 on: April 11, 2011, 07:00:54 pm »
I don't use FB embedded.
I have Firebird_2_1 installed.
Before a minutes:
1. I did copy fbclient.dll from C:\Program Files (x86)\Firebird\Firebird_2_1 to the Desktop;
2. Made fbclientD.dll as a copy of fbclient.dll;
3. Copy both fbclientD.dll and fbclient.dll into:
3.1. Database directory, test with the program = without success;
3.2. Application directory, test with the program = without success;
3.3. Windows\ directory, test with the program = without success;
3.4. Windows\System32\ directory, test with the program = without success;

Arbee

  • Full Member
  • ***
  • Posts: 223
Re: Wich from LCL to use for work with Firebird
« Reply #12 on: April 11, 2011, 08:57:31 pm »
But if you do not use FB Embedded, you should fill the hostname with 'localhost'.

Leaving the hostname empty will persuade SqlDb to try and use FB embedded.  An that requires some more DLL files than just a client dll.
1.0/2.6.0  XP SP3 & OS X 10.6.8

Arbee

  • Full Member
  • ***
  • Posts: 223
Re: Wich from LCL to use for work with Firebird
« Reply #13 on: April 11, 2011, 09:20:26 pm »
What I forgot to mention...

I think for IBConnection the DLL must be renamed to gds32.dll.  It is the old name for the Interbase DLL.
1.0/2.6.0  XP SP3 & OS X 10.6.8

finalist

  • Jr. Member
  • **
  • Posts: 99
Re: Wich from LCL to use for work with Firebird
« Reply #14 on: April 11, 2011, 09:53:11 pm »
Unfortunately I did change HostName to 'localhost', but it was not raise opening of SQLQuery.
May be I need to fill again DeleteSQL, InsertSQL and ModifySQL properties of the SQLQuery.

 

TinyPortal © 2005-2018