我似乎遇到了從示例C#應用程序連接到嵌入式FireBird數據庫的問題。這是我得到的。從C#應用程序連接到嵌入式FireBird數據庫問題
static void Main(string[] args)
{
//Some constant parameters used to form up the connection string...
#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
//I check whether we actually have a database file nearby
//and fbembed.dll. If we don't - we leave
if (File.Exists(DBPath) == true && File.Exists(DLLPath) == true)
{
//I form up a connection string out of literals I've declared above
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;
//And then I finally try to connect
FbConnection Conn = new FbConnection(CStr.ToString());
try
{
//See what we've got in the end
Console.WriteLine(CStr.ToString());
//And try to connect
Conn.Open();
}
catch (Exception Ex)
{
//Show me what has gone wrong
Console.WriteLine("\n" + Ex.Message.ToString());
Console.ReadKey();
}
finally
{
Conn.Close();
}
}
}
的問題是,它產生了我
服務器類型=嵌入式;用戶ID = SYSDBA;密碼= masterkey;方言= 3;初始目錄= d:TMP \ 1 \ cafw.fdb;字符集= WIN1251;客戶端庫= fbembed.dll
沒有找到錯誤代碼335544972的消息。
作爲輸出無效ESCAPE序列
。
我搜索了大約335544972錯誤代碼,它似乎是關於無效連接字符串的東西,但我還沒有找到任何有關「官方」的信息。
Hase有人遇到過類似的東西,所以人們可以告訴我我做錯了什麼?
謝謝。
UPD: 由於它已被建議,我試圖簡化我的連接字符串。因此,而不是做了什麼上面我用
FbConnection Conn = new FbConnection("Database=D:\\tmp\\1\\cafw.fdb;ServerType=1");
,它給我的信息是「可信驗證不支持嵌入式火鳥」。所以,我試圖使用常規的sysdba登錄
FbConnection Conn = new FbConnection("Database=D:\\tmp\\1\\cafw.fdb;ServerType=1;User=SYSDBA;Password=masterkey");
並得到了非常相同的錯誤消息。