Microsoft Access 数据库发动机找不到对象“c:\windows\system32\inetsrv\user1.xlsx”
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();
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();
文章评论
相关解决方案
- 1Microsoft Access 数据库发动机找不到输入表或查询“abcd”
- 2C#给Excel插入数据报Microsoft Office Access 数据库引擎找不到对象“BlogClass”。请确定该对象存在
- 3数据库发动机
- 4Microsoft Jet 数据库引擎找不到对象'Sheet1$'。请确定对象是否存在,并正确地写出它的名称和路径。该如何处理
- 5Microsoft Jet 数据库引擎找不到对象'Sheet1$'请确定对象是否存在,并正确地写出它的名称和路径。解决思路
- 6找不到对象解决思路
- 7异常:找不到对象
- 8sql语句中数据库找不到对象, sql语句读取excel文件解决方案
- 9sql话语中数据库找不到对象, sql语句读取excel文件
- 10[转]HSQL 数据库发动机