2014-01-20 246 views
0

如果你訪問:System.Data.OleDb.OleDbException:不是有效的文件名

http://www.acoin.co.il/

,你會看到錯誤/消息:

源錯誤:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

堆棧跟蹤:

[OleDbException (0x80004005): Not a valid file name.] 
    System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) +351 
    System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +86 
    System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +31 
    System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +76 
    System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126 
    System.Data.OleDb.OleDbConnection.Open() +43 
    Acoin.index.Page_Load(Object sender, EventArgs e) +145 
    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 
    System.Web.UI.Control.OnLoad(EventArgs e) +91 
    System.Web.UI.Control.LoadRecursive() +74 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207 

這是我的代碼;

string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=http://www.acoin.co.il/database1.mdb;Persist Security Info=False"; 
OleDbConnection conn = new OleDbConnection(connectionString); 
conn.Open(); 
+2

在這種連接字符串中不能使用http協議。文件必須是本地的或在局域網上。由於它看起來與代碼位置相同,請嘗試'Data Source = database1.mdb'或者使用相對於代碼位置 –

回答

0

好像該URL被打破(無關OLEDB連接):

http://www.acoin.co.il/database1.mdb

404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

不過,我會感到驚訝,如果你可以使用一個HTTP URL作爲數據庫文件位置

+0

的位置,但輸入http://www.acoin.co.il/data/ open database.mdb ans wtf ?! –

相關問題