我希望我的用戶無法看到我正在使用的MS Access * .accdb數據庫。所以我想將它嵌入到程序集中。我應該怎麼做?將Access * .accdb數據庫嵌入到.NET應用程序中
我的猜測是修改連接字符串。
通過導入嚮導自動創建與數據庫的連接。連接字符串可以在文件Settings.Designer.vb
中找到,並已寫成這樣:
Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.SpecialSettingAttribute(Global.System.Configuration.SpecialSetting.ConnectionString), _
Global.System.Configuration.DefaultSettingValueAttribute("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\MyDatabase.accdb;" & "Persist Security Info=True")
有沒有一種方法我可以改變Data Source=|DataDirectory|\MyDatabase.accdb
(最後一行,向右滾動)到別的東西?
我在how embed resources上找到了一篇文章,但似乎並不適用於連接字符串。此外,似乎(至少在2008年),to access an MS Access Database, it had to be taken out of its embedded state。這將使我的程序中無用的嵌入。
任何幫助非常感謝。