string file_path = Server.MapPath(@".\file\ado.xls");
string m_con = @"Provider=Microsoft.Jet.OLEDB.4.0;Source=" + file_path + ";Extended Propertice=Excel 8.0;";
OleDbConnection con = new OleDbConnection(m_con);
try
{
con.Open();
Response.Write("成功!");
}
catch
{
Response.Write("失败!");
}
输出结果:失败
string m_con = @"Provider=Microsoft.Jet.OLEDB.4.0;Source=" + file_path + ";Extended Propertice=Excel 8.0;";
OleDbConnection con = new OleDbConnection(m_con);
try
{
con.Open();
Response.Write("成功!");
}
catch
{
Response.Write("失败!");
}
输出结果:失败
这个修改后还是失败
连接字串