2013-07-18 34 views
1

當我跑我的aspx文件我得到這個:如何解決數據庫認證錯誤

 No error message available, result code: DB_SEC_E_AUTH_FAILED(0x80040E4D). 

這是爲什麼恰好發生了什麼?

這裏是我的web.config文件:

<add name="2007 Database 05-12-2013(Esfahanian's conflicted copy 2013-06-24) 
    ConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data 
    Source=" providerName="System.Data.OleDb"/> 

這裏相對路徑在我aspx文件:

<script runat="server"> 
    string connectionString = ConfigurationManager 
    .ConnectionStrings["2007 Database 
    05-12-2013(Esfahanian's conflicted copy 2013-06-24)ConnectionString"] 
    .ConnectionString + HttpContext.Current.Server.MapPath(@"Anderson\2007 
    Database 05-12-2011 (Esfahanian's conflicted copy 2013-06-24).mdb"); 
</script> 
+0

web.config中的字符串看起來像它缺少一些作品,但我還沒有與Jet.OLEDB工作過,所以我不當然。 –

回答

3

連接字符串肯定是不對的。 「名稱」屬性僅在您的應用程序內部使用,在本例中爲.aspx文件。您需要在實際連接字符串中的某個位置具有數據庫文件的名稱。

這是我最喜歡的所有的東西連接字符串來源: http://www.connectionstrings.com

+0

我沒有看到任何東西使相對路徑,所有的例子顯示絕對 – foobar2023

+0

谷歌是你的朋友:http://stackoverflow.com/questions/1833640/connection-string-with-relative-path-to-the-數據庫文件 – Bill

相關問題