日期:2014-05-17  浏览次数:20972 次

Microsoft Access 数据库引擎找不到对象“c:\windows\system32\inetsrv\user1.xlsx”。
Microsoft Access 数据库引擎找不到对象“c:\windows\system32\inetsrv\user1.xlsx”。请确保该对象存在,并正确拼写其名称和路径名。如果“c:\windows\system32\inetsrv\user1.xlsx”不是本地对象,请检查网络连接或与服务器管理员联系。
private DataSet ExcelData(string filepath,string filename)
        {

            string strConn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + filename + ";Extended Properties=\"Excel 12.0;HDR=yes;IMEX=1;\"";
            OleDbConnection oleConn = new OleDbConnection(strConn);
            oleConn.Open();//这个地方报错是什么原因
            string olestr = "select * from [Sheet1$]";
            OleDbCommand oleComm = new OleDbCommand(olestr, oleConn);
            oleComm.Connection = oleConn;
            OleDbDataAdapter oleDa = new OleDbDataAdapter();
            oleDa.SelectCommand = oleComm;
            DataSet ds = new DataSet();
            oleDa.Fill(ds);
            oleConn.Close();
            return ds;

        }
还有下面这段代码,有问题吗?
                        string Path = Server.MapPath("Excel");
                    fileloads.PostedFile.SaveAs(Path + "\\" + filename);
                    murl = (Path + "\\" + filename).ToString();