Subject Re: how to detect which client library is currently loaded
Author hsdev77
Hi Martijn/Helen,
What Martijn said is exactly what I'm trying to say: Is there any API,
which will give a different result, so from it we can determine what
type of currently loaded dll/connected server.
The only thing I can imagine is by trying to connect with random
username and random password. If succesfully connected, then it's the
embedded server (no user authentification) otherwise it's fbclient.
But I'm expecting a 'cleaner' way to do it.

Thanks for your prompt reponse to both of you.
Brgds-HS.
--- In firebird-support@yahoogroups.com, "Martijn Tonies"
<m.tonies@...> wrote:
>
>
>
>
> > At 07:40 PM 6/03/2006, you wrote:
> > >How to detect which client library (fbclient or fbembed) is currently
> > >loaded. Any Firebird API to call ?
> >
> > LOL! the client library *is* the API. So - no, there isn't an API
> > call that says "am I really me?" The API is identical, regardless of
> > which client library you're actually using. It might even be
> > libfbclient.so on a Linux client, but the API is still the same.
> >
> >
> > >Actually the goal is to make a standalone application (eg. with
> > >Delphi/FIB/IBO) and want to limit it only to use embedded client
> > >library. How to know that the loaded library is the correct
> > >fbembed.dll instead of fbclient.dll (for eg. user has renamed the
> > >fbclient.dll into fbembed.dll)
> >
> > You don't. Even your application can only look in the application
> > directory and make sure a file of the right name (and perhaps size)
> > is there before the LoadLibrary call.
> >
> > You have to trust the user not to mess around with the
> > installation. If not, can your user be trusted not to delete the
> > database file? Or the application executable?
>
> Wouldn't "embedded" return "Firebird 1.5 Embedded" or something
> like that for the server string?
>
> Martijn Tonies
> Database Workbench - tool for InterBase, Firebird, MySQL, 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
>