Domanda

I'm trying to deploy my Application that uses a Firebird v2.5 database to a client machine.

I am trying to use a minimum installation, without the need to run any other installers. From what I gather, all I need to do is copy the "FBClient.dll" to the target application folder (which includes firebird database file). I have tried this and it still reports an error about not being able to find the correct .net data provider.

eg

C:\Program Files (x86)\MyApp\myApp.exe 
C:\Program Files (x86)\MyApp\fbDatabase.fdb 
C:\Program Files (x86)\MyApp\fbclient.dll 

The error produced is:

Failed to find or load the registered .Net Framework Data Provider.

Also have copied, renamed and included fbclient.dll as fbembed.dll

I have also tried to copy a bunch of other files to the app directory, as well as placing fbclient.dll into the c:\, c:\windows, c:\windows\system.

I also tried installing the client installation, with no joy too.

Is there a way, that I can use the firebird database, without manually editing the machine.config files or using the gac and going through the hell that I went through to install firebird on the dev machine? I want an application that a user can install, not requiring that it be installed by a developer.

Please note, the application that I am writing is for a single machine, single user environment, who knows how to double click the install button, with the attention span of a gnat, that if required to do more than double click install and then press GO, will simply get bored and press the cancel, forget it button.

I add the file "FirebirdSql.Data.FirebirdClient.dll" to the application folder and I no longer get the Data provider error, instead I get the following

"Unable to complete network request to host \"DevMachine\"."

at FirebirdSql.Data.Client.Managed.Version10.GdsConnection.Connect()
at FirebirdSql.Data.FirebirdClient.ClientFactory.CreateManagedDatabase(FbConnectionString options)
at FirebirdSql.Data.FirebirdClient.ClientFactory.CreateDatabase(FbConnectionString options)
at FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect()

I am trying to connect with the following

string file = @"C:\Program Files (x86)\MyApp\Test.FDB;";
FbConnection con = new FbConnection("User=SYSDBA;" + "Password=masterkey;" + "Database=" + file + "DataSource=Dev-VS-W7VM;" + "Port3050;" + "Dialect=3;" + "Charset=ISO8859_1;");
        try
        {
            con.Open();
        }
        catch (Exception e)
        {
            MessageBox.Show(e.ToString());
        }

I have included FirebirdSql.Data.FirebirdClient in my project and installation folder (..\MyApp) Thank you in advance.

È stato utile?

Soluzione

You have to grap a zip and copy FirebirdSql.Data.FirebirdClient.dll to bin folder.

I wonder how you wrote your application that it works without the file (probably installed .msi) :)

Altri suggerimenti

You needed to install .net provider http://www.firebirdsql.org/en/net-provider/

The database file resides next to your application's exe module. So, you need in local server running or embedded server in order to work with data. For embedded server a minimal set of files is (specifed relatively to an application folder):

\UDF (folder with UDF needed if any)
\Intl (with contents from FB installation)
fbembed.dll
firebird.msg
ib_util.dll
icudt30.dll
icuin30.dll
icuuc30.dll
Microsoft.VC80.CRT.manifest
msvcp80.dll
msvcr80.dll

for a full scale server (i.e. not an embedded) a list of files would be:

\UDF (folder with UDF needed if any)
\Intl (with contents from FB installation)
fbserver.exe or fb_inet_server.exe
fbclient.dll
firebird.msg
ib_util.dll
icudt30.dll
icuin30.dll
icuuc30.dll
Microsoft.VC80.CRT.manifest
msvcp80.dll
msvcr80.dll
security2.fdb
firebird.conf   (if non default parameters used)

But then you would need in setting up service record for FB or start it as an application before your application start.

Installation of the Firebird as a service could be done with instsvc.exe utility. Appropriate commands:

  instsvc install -s -a
  instsvc start

Also you should take care of two things:

  1. FileName must be a local file, not in a shared folder from another server.

  2. Appending the firebird server IP before the filename. If you are running your app always in the firebird server, or you are using embeded fbclient.dll, than it should be like

    FbConnection con = new FbConnection("User=SYSDBA;" + "Password=masterkey;" + "Database=localhost:" + file + "DataSource=Dev-VS-W7VM;" + "Port3050;" + "Dialect=3;" + "Charset=ISO8859_1;");

Some fbclient.dll version will allow you not to add localhost and still connect on local files, or use \\servername\c:\filename format instead of localhost:c:\filename, but it is deprecated and not supposed to work anymore (and can work depending on windows version).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top