Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebird .NET provider and embedded server 3

I'm trying to use .NET Firebird Provider to connect to the embedded FB 3.0.1 server.

As far as I know, (also written here (page 6)), there is no more fbclient.dll\fbembed.dll but a single client fbclient.dll used for remote and embedded access.

But when I call the FBConnection.Open() I get a System.DllNotFoundException:

Unable to load DLL 'fbembed': 
Impossible to find the specified module (Exception from HRESULT: 0x8007007E).

Any ideas?

like image 556
Barzo Avatar asked Feb 01 '17 13:02

Barzo


People also ask

How do I connect to my Firebird database?

Connecting to a Firebird database requires the user to authenticate using a user name and a valid password. Any user other than SYSDBA, root (on Posix systems), or Administrator (on Windows systems, if Firebird runs as this user) needs also to have permissions to objects inside a database.

Where is Fbembed DLL?

The root directory of the embedded server is the one where the embedded library binary (fbembed. dll, usually renamed to fbclient.

How do you start a Firebird?

If the Superserver is not running, or the Classic server is not initialized, it can be started or restarted manually by selecting it from the Start ➤Programs ➤Firebird menu. Alternatively, the Guardian or the server can be started from the command prompt.


1 Answers

Looking in the Provider code the default Client Library is fbembed (maybe for compatibility):

internal const string DefaultValueClientLibrary = "fbembed";

Now, passing the new value to the ConnectionString do the trick:

  var connectionString = new FbConnectionStringBuilder
  {
    Database = dbPath,
    ServerType = FbServerType.Embedded,
    UserID = "SYSDBA",
    Password = "masterkey",
    ClientLibrary = "fbclient.dll"
  }.ToString();
like image 174
Barzo Avatar answered Sep 27 '22 22:09

Barzo