I'm trying to connect to a embedded firebird database using de following code:
var cmm = new FbCommand();
var csb = new FbConnectionStringBuilder();
csb.ServerType = FbServerType.Embedded;
csb.UserID = "SYSDBA";
csb.Password = "masterkey";
csb.Dialect = 3;
csb.Charset = "UTF8";
csb.Database = @"TESTE.FDB";
cmm.Connection = new FbConnection(csb.ConnectionString);
try
{
cmm.Connection.Open();
cmm.CommandText = "SELECT NOME FROM TESTE WHERE ID=2";
MessageBox.Show(Convert.ToString(cmm.ExecuteScalar()));
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
cmm.Connection.Close();
}
The query execute depending of the directory of the program. If I open the program in the directory "C:\np" or other local directory, it works normally. But, if the directory is a network mapping, I receive the following error: "Unable to complete network request to host "psf". Failed to establish a connection."
What can I do to resolve this situation? Thanks.