Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-07

Cannot connect Firebird server

22 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Sławek

Hello,

I'd like to start a new life (after Delphi) with Lazarus IDE but got into trouble with basic Firebird connection procedure :( Error message: Cannot load default Firebird clients (fbembed.dll or gds32.dll) ??

System Win7,64bit,home
Firebird 2.5/32bit installed on local machine from zip package; database located on local machine
Lazarus 32bit, 0.9.30.4

Any hints ?

Thanks in advance!
S?awek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120725/f608042b/attachment.html>

Reply by email

Unknown author
to Sławek
S?awek wrote 13 lines
Hello, I'd like to start a new life (after Delphi) with Lazarus IDE but got into trouble with basic Firebird connection procedure :( Error message: Cannot load default Firebird clients (fbembed.dll or gds32.dll) ?? System Win7,64bit,home Firebird 2.5/32bit installed on local machine from zip package; database located on local machine Lazarus 32bit, 0.9.30.4 Any hints ?

First, make sure that fbclient.dll is in the PATH

Then, try adding

   InitialiseIBase60('fbclient.dll');

as the first line in your program source.

Michael.

Reply by email

Reinier Olislagers
to Sławek: I'd like to start a new life (after Delphi) with Lazarus IDE but got into trouble with…
S?awek wrote 13 lines
Hello, I'd like to start a new life (after Delphi) with Lazarus IDE but got into trouble with basic Firebird connection procedure :( Error message: Cannot load default Firebird clients (fbembed.dll or gds32.dll) ?? System Win7,64bit,home Firebird 2.5/32bit installed on local machine from zip package; database located on local machine Lazarus 32bit, 0.9.30.4 Any hints ?

Dzien dobry Slawek,

Yes. Where is your fbembed.dll/fbclient.dll and its associated files? (Note: you don't just need one DLL, you also need icudt30.dll etc).

Does this occur in design time or run time? I'm guessing the latter...

For design-time support, you need them in your project directory (where your source is), I think you can also put it in your lazarus directory so you can use it for all projects.

You also need to put them in the directory where the executable is generated.

If you want to use Firebird embedded (instead of the regular server): older versions of FPC required to explictly set a variable (or as workaround, renambe fbembed.dll to fbclient.dll). Don't know if that is still the case with the version distributed with Laz 0.9.30.4

See http://wiki.lazarus.freepascal.org/firebird for an explanation on that. If anything is unclear, let me know and I will update the wiki page - or you can do it yourself ;)

Finally, I see you are using Laz 32 bit. Fine. There are known problems with x64 FPC/Lazarus with embedded Firebird due to faulty FPC exception handling (e.g. bug 21581) but you don't need to worry about that.

Regards,
Reinier

Reply by email

Reinier Olislagers
to Unknown author: First, make sure that fbclient.dll is in the PATH Then, try adding…
Show quoted text 18 lines
On Wed, 25 Jul 2012, S?awek wrote: > Hello, > > I'd like to start a new life (after Delphi) with Lazarus IDE but > got into trouble with basic Firebird connection procedure :( Error > message: Cannot load default Firebird clients (fbembed.dll or > gds32.dll) ?? > > System Win7,64bit,home Firebird 2.5/32bit installed on local > machine from zip package; database located on local machine Lazarus > 32bit, 0.9.30.4 > > Any hints ? First, make sure that fbclient.dll is in the PATH

Ah yes, that's of course a neat solution for a dev PC... hadn't thought about that ;)

Then, try adding InitialiseIBase60('fbclient.dll'); as the first line in your program source.

AFAIU, via fpc\packages\ibase\src\ibase60.inc, fbclient.dll should be searched automatically, as well as gds32.dll; in newer FPC (at least since revision 20112) fbembed.dll would be searched (though unfortunately not first in the sequence)
Wouldn't InitialiseIBase60 be superfluous?

Reply by email

Unknown author
to Reinier Olislagers
Reinier Olislagers wrote 21 lines
On 25-7-2012 12:40, wrote: > > > On Wed, 25 Jul 2012, S?awek wrote: > >> Hello, >> >> I'd like to start a new life (after Delphi) with Lazarus IDE but >> got into trouble with basic Firebird connection procedure :( Error >> message: Cannot load default Firebird clients (fbembed.dll or >> gds32.dll) ?? >> >> System Win7,64bit,home Firebird 2.5/32bit installed on local >> machine from zip package; database located on local machine Lazarus >> 32bit, 0.9.30.4 >> >> Any hints ? > > First, make sure that fbclient.dll is in the PATH Ah yes, that's of course a neat solution for a dev PC... hadn't thought about that ;)

It must be true on a client PC as well.

Show quoted text 10 lines
> Then, try adding InitialiseIBase60('fbclient.dll'); as the first line > in your program source. AFAIU, via fpc\packages\ibase\src\ibase60.inc, fbclient.dll should be searched automatically, as well as gds32.dll; in newer FPC (at least since revision 20112) fbembed.dll would be searched (though unfortunately not first in the sequence) Wouldn't InitialiseIBase60 be superfluous?

That's why I added 'then'. It's only the second option.

Michael.

Reply by email

Sławomir Cabaj
to Unknown author: First, make sure that fbclient.dll is in the PATH Then, try adding…

W dniu 2012-07-25 12:40, pisze:

Show quoted text 32 lines
On Wed, 25 Jul 2012, S?awek wrote: > Hello, > > I'd like to start a new life (after Delphi) with Lazarus IDE but got > into trouble with basic Firebird connection procedure :( > Error message: Cannot load default Firebird clients (fbembed.dll or > gds32.dll) ?? > > System Win7,64bit,home > Firebird 2.5/32bit installed on local machine from zip package; > database located on local machine > Lazarus 32bit, 0.9.30.4 > > Any hints ? First, make sure that fbclient.dll is in the PATH Then, try adding InitialiseIBase60('fbclient.dll'); as the first line in your program source. Michael. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Putting "InitialiseIBase60('fbclient.dll');" generated "Identifier not found InitialiseIBase60"

but it works when fbclient.dll is located in SysWOW64 directory !

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120725/ba352681/attachment.html>

Reply by email

Unknown author
to Sławomir Cabaj
S?awomir Cabaj wrote 35 lines
W dniu 2012-07-25 12:40, pisze: > > > On Wed, 25 Jul 2012, S?awek wrote: > >> Hello, >> >> I'd like to start a new life (after Delphi) with Lazarus IDE but got into >> trouble with basic Firebird connection procedure :( >> Error message: Cannot load default Firebird clients (fbembed.dll or >> gds32.dll) ?? >> >> System Win7,64bit,home >> Firebird 2.5/32bit installed on local machine from zip package; database >> located on local machine >> Lazarus 32bit, 0.9.30.4 >> >> Any hints ? > > First, make sure that fbclient.dll is in the PATH > > Then, try adding > InitialiseIBase60('fbclient.dll'); > as the first line in your program source. > > Michael. > > > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus Putting "InitialiseIBase60('fbclient.dll');" generated "Identifier not found InitialiseIBase60"

Yes, you must of course add the Ibase60dyn unit to the uses clause. I forgot to mention that.

but it works when fbclient.dll is located in SysWOW64 directory !

That particular problem happens often :)

Michael.

Reply by email

Reinier Olislagers
to Unknown author: It must be true on a client PC as well. That's why I added 'then'. It's only the second…
Show quoted text 10 lines
On Wed, 25 Jul 2012, Reinier Olislagers wrote: > On 25-7-2012 12:40, wrote: >> On Wed, 25 Jul 2012, S?awek wrote: >>> Any hints ? >> >> First, make sure that fbclient.dll is in the PATH > Ah yes, that's of course a neat solution for a dev PC... hadn't thought > about that ;) It must be true on a client PC as well.

It's just that I'd be loath to change a client's PATH; I'd rather put the dlls in the application directory and avoid any issues with existing Firebird dlls being in the PATH etc.

Show quoted text 10 lines
>> Then, try adding InitialiseIBase60('fbclient.dll'); as the first line >> in your program source. > > AFAIU, via fpc\packages\ibase\src\ibase60.inc, fbclient.dll should be > searched automatically, as well as gds32.dll; in newer FPC (at least > since revision 20112) fbembed.dll would be searched (though > unfortunately not first in the sequence) > Wouldn't InitialiseIBase60 be superfluous? That's why I added 'then'. It's only the second option.

Got it,

thanks,
Reinier

Reply by email

Graeme Geldenhuys
to Unknown author: First, make sure that fbclient.dll is in the PATH Then, try adding…

Hi,

Then, try adding InitialiseIBase60('fbclient.dll'); as the first line in your program source.

Why do you need that? All my tiOPF based apps, and tiOPF itself doesn't contain such a line, yet I connect to Firebird without problems.

Just curious, as this is the first time I hear about that function call.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Graeme Geldenhuys
to Reinier Olislagers: Yes. Where is your fbembed.dll/fbclient.dll and its associated files? (Note: you don't…
Reinier Olislagers wrote
For design-time support, you need them in your project directory (where your source is), I think you can also put it in your lazarus directory so you can use it for all projects.

Huh?

You also need to put them in the directory where the executable is generated.

Double huh?

I don't do either of those, and I connect to firebird servers no problems. Under Windows, download the Firebird Installation/Setup, and simply select the "client only" option during the install. Lazarus, FPC and your programs will work just fine then. No need to copy Firebird DLL's around manually - the Firebird Setup does everything for you already.

If you want to use Firebird embedded (instead of the regular server):

Never used this, but I believe in this case you need the fbembed.dll in the same directory as the executable, or somewhere in your Library Path.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys: Why do you need that? All my tiOPF based apps, and tiOPF itself doesn't contain such a…
Graeme Geldenhuys wrote 14 lines
Hi, On 25 July 2012 11:40, wrote: > > Then, try adding > InitialiseIBase60('fbclient.dll'); > as the first line in your program source. Why do you need that? All my tiOPF based apps, and tiOPF itself doesn't contain such a line, yet I connect to Firebird without problems. Just curious, as this is the first time I hear about that function call.

The call is implicit when you connect to firebird for the first time with SQLDB. It loads the library, and then loads all entry points it finds.

It just means that in your case, the library is always correctly found. (which is a good thing)

You might need the call if the default load sequence is not to your liking. I think it first tries embedded, then FB and finally Interbase.

if you want to force interbase on a system where also Firebird is installed, then you would put a

  InitialiseIBase60('gds32.dll');

at the start.

I use this for instance to switch between embedded and full client/server. The earliest versions of fbembed did not support connecting to a remote database.

Michael.

Reply by email

Mark Morgan Lloyd
to Graeme Geldenhuys: Huh? Double huh? I don't do either of those, and I connect to firebird servers no…
Graeme Geldenhuys wrote 27 lines
On 25 July 2012 11:45, Reinier Olislagers wrote: > For design-time support, you need them in your project directory (where > your source is), I think you can also put it in your lazarus directory > so you can use it for all projects. Huh? > You also need to put them in the directory where the executable is > generated. Double huh? I don't do either of those, and I connect to firebird servers no problems. Under Windows, download the Firebird Installation/Setup, and simply select the "client only" option during the install. Lazarus, FPC and your programs will work just fine then. No need to copy Firebird DLL's around manually - the Firebird Setup does everything for you already. > If you want to use Firebird embedded (instead of the regular server): Never used this, but I believe in this case you need the fbembed.dll in the same directory as the executable, or somewhere in your Library Path.

Which is pretty much what Reinier is saying in the advice you've disparaged.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt: The call is implicit when you connect to firebird for the first time with SQLDB. It loads…

Hi,

Michael Van Canneyt wrote
It just means that in your case, the library is always correctly found. (which is a good thing)

Is there any other way. :-)

if you want to force interbase on a system where also Firebird is installed, then you would put a

Ah, ok - that makes sense. And only applies is special cases.

Thanks for the info.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Graeme Geldenhuys
to Mark Morgan Lloyd: Which is pretty much what Reinier is saying in the advice you've disparaged. Mark Morgan…
Mark Morgan Lloyd wrote
Which is pretty much what Reinier is saying in the advice you've disparaged.

Nope. I agree with his last paragraph of his message - which relates to fbembed.dll.

The earlier part of his message seems to refer to a Client/Server setup, and those instructions seem odd, and what I don't agree with. The Firebird Setup (client only option) is all you need if you want to connect to a Firebird server.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Mark Morgan Lloyd
to Michael Van Canneyt: The call is implicit when you connect to firebird for the first time with SQLDB. It loads…
Michael Van Canneyt wrote 23 lines
On Thu, 26 Jul 2012, Graeme Geldenhuys wrote: > Hi, > > On 25 July 2012 11:40, wrote: >> >> Then, try adding >> InitialiseIBase60('fbclient.dll'); >> as the first line in your program source. > > > Why do you need that? All my tiOPF based apps, and tiOPF itself > doesn't contain such a line, yet I connect to Firebird without > problems. > > Just curious, as this is the first time I hear about that function call. The call is implicit when you connect to firebird for the first time with SQLDB. It loads the library, and then loads all entry points it finds. It just means that in your case, the library is always correctly found. (which is a good thing)

Importantly, I think that all of the database packages have now been updated to allow the location of the library to be passed as a parameter, which means that a privileged user no longer has to set up symlinks etc.

Grepping the case of PostgreSQL, it appears that this was introduced in 2.6.0 (what I wrote earlier was pessimistic, I should have checked the current release).

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Reinier Olislagers
to Graeme Geldenhuys: On 26 July 2012 09:07, Mark Morgan Lloyd Nope. I agree with his last paragraph of his…
Graeme Geldenhuys wrote
The earlier part of his message seems to refer to a Client/Server setup, and those instructions seem odd, and what I don't agree with. The Firebird Setup (client only option) is all you need if you want to connect to a Firebird server.

My instructions refer to a client lib connecting to a server on the same or another computer. See my other post.

Reply by email

Reinier Olislagers
to Graeme Geldenhuys: Huh? Double huh? I don't do either of those, and I connect to firebird servers no…
Graeme Geldenhuys wrote 20 lines
On 25 July 2012 11:45, Reinier Olislagers wrote: > For design-time support, you need them in your project directory (where > your source is), I think you can also put it in your lazarus directory > so you can use it for all projects. Huh? > You also need to put them in the directory where the executable is > generated. Double huh? I don't do either of those, and I connect to firebird servers no problems. Under Windows, download the Firebird Installation/Setup, and simply select the "client only" option during the install. Lazarus, FPC and your programs will work just fine then. No need to copy Firebird DLL's around manually - the Firebird Setup does everything for you already.

Because it either copies dlls to the system (syswow64) directory which is in your path or changes your path and adds the location of the dlls (c:\program files\firebird...whatever\).

I'm describing a method that does not mess with a user's path but contains the dlls in the application directory. I think this is much safer than fiddling with a users's environment, because it can break other applications and it is not as robust (imagine an interbase gds32.dll in an earlier path of the path overriding the fbclient.dll you just added to the path).

Not a problem on your own dev machine but problematic when messing with end users PCs that get your application.

Show quoted text 5 lines
> If you want to use Firebird embedded (instead of the regular server): Never used this, but I believe in this case you need the fbembed.dll in the same directory as the executable, or somewhere in your Library Path.

I used this.

Reply by email

Reinier Olislagers
to Michael Van Canneyt: The call is implicit when you connect to firebird for the first time with SQLDB. It loads…
Michael Van Canneyt wrote 24 lines
On Thu, 26 Jul 2012, Graeme Geldenhuys wrote: > Hi, > On 25 July 2012 11:40, wrote: >> >> Then, try adding >> InitialiseIBase60('fbclient.dll'); >> as the first line in your program source. > > > Why do you need that? All my tiOPF based apps, and tiOPF itself > doesn't contain such a line, yet I connect to Firebird without > problems. > > Just curious, as this is the first time I hear about that function call. The call is implicit when you connect to firebird for the first time with SQLDB. It loads the library, and then loads all entry points it finds. It just means that in your case, the library is always correctly found. (which is a good thing) You might need the call if the default load sequence is not to your liking. I think it first tries embedded, then FB and finally Interbase.

Nope, unfortunately it doesn't try embedded first, but last. See my earlier post.

Show quoted text 6 lines
if you want to force interbase on a system where also Firebird is installed, then you would put a InitialiseIBase60('gds32.dll'); at the start.

Yes, that's useful.

Reply by email

Sławomir Cabaj
to Graeme Geldenhuys: On 26 July 2012 09:07, Mark Morgan Lloyd Nope. I agree with his last paragraph of his…

W dniu 2012-07-26 10:24, Graeme Geldenhuys pisze:

Show quoted text 13 lines
On 26 July 2012 09:07, Mark Morgan Lloyd wrote: > Which is pretty much what Reinier is saying in the advice you've disparaged. Nope. I agree with his last paragraph of his message - which relates to fbembed.dll. The earlier part of his message seems to refer to a Client/Server setup, and those instructions seem odd, and what I don't agree with. The Firebird Setup (client only option) is all you need if you want to connect to a Firebird server.

Firebird install path is written in win registry and on windows it should be enough to find fbclient.dll but nevertheless it would be better to have a possibility to point the fbclient.dll directly for instance in IBConnection properties.
BTW: when I put Firebird path into project options / library paths Lazarus complains it "contains unusual characters", probably it means "/Program Files (x86)/" dir
but it doesn't check this path as a possible resource of fbclient.dll, it must be in the PATH or located in SysWOW64 dir

S?awek

Reply by email

Graeme Geldenhuys
to Reinier Olislagers: My instructions refer to a client lib connecting to a server on the same or another…
Reinier Olislagers wrote
My instructions refer to a client lib connecting to a server on the same or another computer. See my other post.

Yes I know that, and still I don't agree with those instructions. I have connected to Firebird database (local & remote) for over 7 years, and never done it that way. The Firebird setup does everything you need.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Graeme Geldenhuys
to Reinier Olislagers: Because it either copies dlls to the system (syswow64) directory which is in your path or…
Reinier Olislagers wrote
other applications and it is not as robust (imagine an interbase gds32.dll in an earlier path of the path overriding the fbclient.dll you just added to the path).

As far as I know the Firebird Setup doesn't by default create a gds32.dll, thus it will NOT override your existing gds32.dll. As default it installs the fbclient.dll and gives you on _optional_ choice to also create/install a gds32.dll for older Interbase applications.

Anyway, enough said. The original poster should be able to sort out his system with the advice given so far.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Reinier Olislagers
to Graeme Geldenhuys
Graeme Geldenhuys wrote 11 lines
On 26 July 2012 09:55, Reinier Olislagers wrote: > other applications and it is not as robust (imagine an interbase > gds32.dll in an earlier path of the path overriding the fbclient.dll you > just added to the path). As far as I know the Firebird Setup doesn't by default create a gds32.dll, thus it will NOT override your existing gds32.dll. As default it installs the fbclient.dll and gives you on _optional_ choice to also create/install a gds32.dll for older Interbase applications.

Client pcs may also have older or newer Interbase clients installed, other Firebird client versions etc...
Seems to me you only have customers where you can control their environments, and you're not willing to acknowledge my point.

I'll leave it as I think we both repeated our standpoints/arguments enough.

Anyway, enough said. The original poster should be able to sort out his system with the advice given so far.

Agreed.

Reply by email