It seems I have a problem connecting to the embedded FireBird database from a C # sample application. Here is what I have.
static void Main(string[] args)
{
#region constant literals
const String User = "SYSDBA";
const String Password = "masterkey";
const String DBPath = "D:\\!tmp\\1\\cafw.fdb";
const String DLLPath = @"fbembed.dll";
const String Charset = "WIN1251";
const int Dialect = 3;
#endregion
if (File.Exists(DBPath) == true && File.Exists(DLLPath) == true)
{
FbConnectionStringBuilder CStr = new FbConnectionStringBuilder();
CStr.ServerType = FbServerType.Embedded;
CStr.UserID = User;
CStr.Password = Password;
CStr.Dialect = Dialect;
CStr.Database = DBPath;
CStr.Charset = Charset;
CStr.ClientLibrary = DLLPath;
FbConnection Conn = new FbConnection(CStr.ToString());
try
{
Console.WriteLine(CStr.ToString());
Conn.Open();
}
catch (Exception Ex)
{
Console.WriteLine("\n" + Ex.Message.ToString());
Console.ReadKey();
}
finally
{
Conn.Close();
}
}
}
The problem is that it gives me
server type = Embedded; user id = SYSDBA; password = masterkey; dialect = 3; initial directory = D :! tmp \ 1 \ cafw.fdb; character set = WIN1251; client library = fbembed.dll
There are no messages for error code 335544972.
Invalid ESCAPE Sequence
as a conclusion.
I figured out to find out about error code 335544972, and this seems like an invalid connection string, but I did not find any "official" information about it.
If anyone comes across something similar so that you can tell me what I'm doing wrong?
Thank.
UPD:
, . , , ,
FbConnection Conn = new FbConnection("Database=D:\\tmp\\1\\cafw.fdb;ServerType=1");
, "Trusted Auth Embedded Firebird". , sysdba login
FbConnection Conn = new FbConnection("Database=D:\\tmp\\1\\cafw.fdb;ServerType=1;User=SYSDBA;Password=masterkey");
.