#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Posts
    16
    Rep Power
    0

    Firebird and Delphi


    Does anyone know of a free set of components or a dbxpress driver for Firebird 1.5? I am trying out the DB and like it, but cannot do real work in it without something to connect. I am trying to compile and install the UIB suite (which has FB 1.5 support) but I keep getting errors from compiler directives that I can't make out. Can anyone help?
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2006
    Posts
    1
    Rep Power
    0
    Originally Posted by FrankL
    Does anyone know of a free set of components or a dbxpress driver for Firebird 1.5? I am trying out the DB and like it, but cannot do real work in it without something to connect. I am trying to compile and install the UIB suite (which has FB 1.5 support) but I keep getting errors from compiler directives that I can't make out. Can anyone help?
    Hi,

    Use dbexpress for the job.

    example:

    // 1) create components ,
    // these are standard i think since delphi 6
    SQLConnection1 := TSQLConnection.create(self);
    SQLDataSet1 := TSQLDataSet.create(self);
    SQLDataSet1.SQLConnection:=SQLConnection1;


    // 2) explicitly use fbclient.dll !
    with SQLConnection1 do
    begin
    SQLHourGlass:=false;
    TableScope := ( [tsTable, tsView]);
    KeepConnection:=true;
    LoginPrompt:=false;
    LoadParamsOnConnect:=false;
    drivername:='Interbase';
    Connectionname:='X';
    getdriverfunc:='getSQLDriverINTERBASE';
    libraryname:='dbexpint.dll';
    //this is changed from default
    vendorlib:='fbclient.dll';
    end;
    // 3) connection params
    With SQLConnection1.Params do
    begin
    add('DriverName=Interbase');
    add('BlobSize=-1');
    add('CommitRetain=False');
    add('ErrorResourceFile=');
    add('LocaleCode=0000');
    add('ServerCharSet');
    add('SQLDialect=1');
    add('Interbase TransIsolation=ReadCommited');
    add('WaitOnLocks=True');



    // database connection info
    add('Database=127.0.0.1:d:\data\database.gdb');
    add('password=masterkey');
    add('User_Name=sysdba');


    end;



    //4 ) put your sql

    SQLDataSet1.CommandText:='SELECT COUNT(*) FROM COUNTRYCODES';

    SQLDataSet1.open;

    //quick test
    showmessage('Nr of records '+ SQLDataSet1.fieldbyname('COUNT').asstring );


    SQLConnection1.CloseDataSets;


    regards, derryck
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Location
    Sarajevo, Bosnia
    Posts
    120
    Rep Power
    14
    Originally Posted by FrankL
    Does anyone know of a free set of components or a dbxpress driver for Firebird 1.5? I am trying out the DB and like it, but cannot do real work in it without something to connect. I am trying to compile and install the UIB suite (which has FB 1.5 support) but I keep getting errors from compiler directives that I can't make out. Can anyone help?
    You can use IBX which is included with delphi, but if you're using delphi 6 or 7, update to latest version. You can find update on codecentral.
    UIB works fine with delphi, and I don't know what can be a reason why you are having problems. Care to post exact message here?
    ZEOS lib is another alternative, but UIB is my favorite...


    --
    Best regards,
    Fikret Hasovic http://fikret.fbtalk.net

    * Firebird Foundation Committee member.
    - Join today at http://www.firebirdsql.org/ff/foundation
    * JEDI VCS contributor
    http://jedivcs.sourceforge.net/
    * Firebird and Fyracle news
    http://www.fyracle.org
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    1
    Rep Power
    0

    Cool


    You can use MDO: Mercury Database Objects:

    MDO is an open source data-access component suite, providing direct access to Firebird from Borland Delphi applications. MDO is a descendant of FreeIBComponents by Greg Deatz, so IBX users looking for a migration path to Firebird can have a look at these
    Is a excelent component!!!

    http://sourceforge.net/projects/mdo

    Bye
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    205
    Rep Power
    15
    Are these components better than FIBPlus? I know FIB is for charge and it's pretty expensive but i like the way it works.

    IBX is an alternative, but it lacks of features and in performance is nowhere related to FIB.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    205
    Rep Power
    15
    i spent a half day today with running almost 200 different performance tests, because i'm a beginner using firebird and firebird components and i needed to know what component and what database settings to use. i'm posting this because these results might be useful for others as well.

    I'm only posting the most talkative tests/results.

    Before the datasheets u have to know my architecture:


    server:
    a simple PC used for by my brother for games
    Conf: AMD Athlon 2200+, 512MB DDR Ram
    DB: Firebird 1.5.3


    client:
    my Compaq Presario R3000 laptop
    Conf: AMD 64bit 3000+, 512MB DDR RAM
    i'm using Delphi 6, Update 2
    and i have 3 components installed for this purpose:
    - IBX (Interbase Express), included in Delphi, updated - FREE
    - MDO (Mercury Database Objects) - FREE
    - FIBPlus - free for try, 199 Euro to buy (i guess)


    network:
    there is a USR 80854 router between them wired to the "server" and wirelessly connected to the "client"
    i have an ping of 70-90 between them (i have no idea why is it so high, if anyone could help me reducing it i'd be thankful)


    i created 3 DB's (with the SAME metadata) on the server:

    - DB1: 2kb pagefile, containing 10.100 records auto-generated test data

    - DB2: 16kb pagefile, containing 10.100 records auto-generated test data

    - DB3: 8kb pagefile, containing 20.000 records auto-generated test data


    The TEST table is:

    Code:
    CREATE TABLE TEST (
        PK       INTEGER NOT NULL,
        NEV      CHAR(30),
        TEL      CHAR(15),
        ADDRESS  CHAR(50),
        FIZU     NUMERIC(15,2)
    );

    The numbers below show the length of the operations in SECONDS.
    Ex: connect 9 = the connection to the DB lasted 9 seconds

    - connect, connect2, connect3 - means that i have connected 3 times to the DB to see if the components did any kind of caching

    - index <name> - means that i applied an index by the <name> field

    - i.cache ADD - means that after trying all indexes i indexed the table again by the field ADDRESS to see if the components cached the indexes


    Now see the results:

    pagefile 2k, 10100 rec
    Code:
    		
    operation		IB	FIB	MDO
    connect		        9	4	9
    connect2		10	2	11
    connect3		9	2	11
    index NEV		9	3	11
    index TEL		7	1	10
    index ADD		8	1	10
    index FIZ		9	1	12
    i.cache ADD		9	1	11


    pagefile 8k, 20000 rec
    Code:
    		
    operation		IB	FIB	MDO
    connect		        9	3	9
    connect2		9	2	11
    connect3		10	2	11
    index NEV		8	4	12
    index TEL		9	1	11
    index ADD		10	1	13
    index FIZ		10	1	12
    i.cache ADD		10	1	12

    pagefile 16k, 10100 rec

    Code:
    	
    operation		IB	FIB	MDO
    connect		        11	2	10
    connect2		9	2	11
    connect3		10	2	11
    index NEV		8	2	12
    index TEL		8	1	10
    index ADD		7	1	10
    index FIZ		9	1	12
    i.cache ADD		7	1	10

    I know my english is not very good since it's not my native language, so in case you did not understand what i tried to show you with my tables and numbers see the screenshots below, maybe they will talk more:

    [IMG]www.harmopan.ro/other/scrsht0.jpg[/IMG]
    [IMG]www.harmopan.ro/other/scrsht1.jpg[/IMG]
    [IMG]www.harmopan.ro/other/scrsht2.jpg[/IMG]

    Comments on this post

    • pabloj agrees : Great work, thank you
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Posts
    16
    Rep Power
    0
    Thanks for the options. I finally got the UIB compiler directives worked out. It is a nice set of components, but after testing several options, I went with IBX. This made a port of an old Paradox program to Firebird very simple. Less than two days work in my spare time. Also, my boss likes this option becuase he has a client who contacted him about upgrading a program the company did a few years. It used the opensource Interbase and IBX. The client doesn't want to go with the pay for version of IB (understandably), so we were talking Firebird. Boss flinched at the thought of ripping out all the IBX components and code. When my boss found out we could use IBX and FB together, he simply smiled.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    205
    Rep Power
    15
    yes, i forgot to add to my post that the big difference between these components only is visible and feelable when working with huuuuuge databases and the components may not slow down the workflow. My principle is that the should always be faster than the operator, you never may let him/her wait.
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2006
    Location
    Netherlands
    Posts
    10
    Rep Power
    0
    I have been testing SQL Server and firebird access with a lot of components, and there is one set of components that is a lot faster then al the other, although I haven't testen FIBLib yet:

    http://fblib.altervista.org/

    these components only implement the dll (fbEmbed, fbclient or GDS32) but because of no overhead, they are realy fast. At the second place was the BDE (yes really), but not for more then 3-4 connections.

    the only thing is they do not implement TDataset, so you can't connect them directly to a dataAware components. They do not cache the resultset.

    I have never seen components inserting 100000 records in less then a minute.
    4 times faster then the BDE, 10 times faster then ADO,
    IBX components crashed in one of my test, so I didn't bother any more.

    they have the least network traffic of all tested components (including those for mssql)

    FBLib is not for D2006 .net VCL, so I made the same implementation as FBLib did for D2006.net VCL, but not with the same results, I think pointer operations are slower in .net.

    (for SQL Server the CoreLabs components where very suitable btw)
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Posts
    16
    Rep Power
    0
    I ran some tests today of IBX vs. dbGo in Delphi 2006 Ent. Here are the results.

    Code:
    Table:
    INS VARCHAR(20)
    OUTS INTEGER
    Only one connection was active at a time (I did not want interference).
    IBX2 is the same components as IBX but explicitly uses startTransaction and commit.

    Code:
    Inserts (10 reps)	
              100	  200	  300	   500	  1000
    IBX	0.453	0.840	1.219	 1.953	 3.813
    ADO     2.550	5.310	8.406	14.546	28.812
    IBX2	0.422	0.875	1.203	 1.906	 3.922
    Table was emptied between IBX run and ADO run (and IBX2 run).
    Code:
    Percent change each run:					
    Inserts (10 reps)	
             100	    200	             300	     500	     1000
    IBX     NA	185.430%	145.119%	160.213%	 195.238%
    ADO     NA	208.235%	158.305%	173.043%	 198.075%
    IBX2    NA	207.513%	137.538%	158.437%	 205.771%
    Code:
    Slower performer's performance decrease					
    	    100	    200	    300	    500	   1000
    ADO	562.91%	632.14%	689.58%	744.80%	755.63%
    Code:
    Select Test. Against a table of 28,000 records.  Return set was 60 records.
    IBX	5.812
    ADO	5.547
    Hope this helps people decide which control set to use!
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    250
    Rep Power
    15
    Your boss might be happy, but do note that IBX WILL NEVER BE TESTED against Firebird by Borland and it will also never be modified by Borland to work against Firebird.

    Using Firebird with IBX is totally unsupported and theoretically can be broken by any IBX update.


    Your decision, of course, but I'd rather go with a component set that really supports Firebird.

    Martijn Tonies
    Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle & MS SQL Server
    Upscene Productions
    http://www.upscene.com
    My thoughts:
    http://blog.upscene.com/martijn/
    Database development questions? Check the forum!
    http://www.databasedevelopmentforum.com

    Comments on this post

    • pabloj agrees
  22. #12
  23. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Posts
    16
    Rep Power
    0
    Your boss might be happy, but do note that IBX WILL NEVER BE TESTED against Firebird by Borland and it will also never be modified by Borland to work against Firebird.

    Using Firebird with IBX is totally unsupported and theoretically can be broken by any IBX update.


    Your decision, of course, but I'd rather go with a component set that really supports Firebird.
    We have discussed that and run into a couple of performance issues with IBX. That's why I ran the benchmarks. Personally, I hope he decides to go for another set myself. I've been more than impressed with DevRace's set.

IMN logo majestic logo threadwatch logo seochat tools logo