1
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
の 'Microsoft.ACE.OLEDB.12.0' プロバイダ:輸入コードの輸入コードのASP .NET
if (flexcel.HasFile)
{
string fileExtension = System.IO.Path.GetExtension(flexcel.FileName);
if (fileExtension == ".xls" || fileExtension == ".xlsx")
{
string fileLocation = Server.MapPath("../Content/MailMarketing/") + flexcel.FileName + month;
if (System.IO.File.Exists(fileLocation))
{
// System.IO.File.Delete(fileLocation);
}
flexcel.SaveAs(fileLocation);
string excelConnectionString = string.Empty;
excelConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" +
Server.MapPath("~/Content/MailMarketing/") + flexcel.FileName + month + ";Extended Properties=\"Excel 12.0;HDR=Yes;IMEX=2\"";
//connection String for xls file format.
if (fileExtension == ".xls")
{
excelConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
fileLocation + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=2\"";
}
//connection String for xlsx file format.
else if (fileExtension == ".xlsx")
{
excelConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" +
Server.MapPath("~/Content/MailMarketing/") + flexcel.FileName + month + ";Extended Properties=\"Excel 12.0;HDR=Yes;IMEX=2\"";
}
//Create Connection to Excel work book and add oledb namespace
OleDbConnection excelConnection = new OleDbConnection(excelConnectionString);
excelConnection.Open();
解決する方法?
私はすでにこのソフトウェアをダウンロードしていますが、まだ動作していません。何か提案?
https://www.microsoft.com/en-us/download/details.aspx?id=23734
私はたくさんのコードを試しましたが、同じ問題があります。どのような提案ですか?
あなたは(http://stackoverflow.com/questions/6649363/microsoft-ace-oledb-12-0-provider-is-not [それをインストールする]試してみました:ここ
は、コードがあります-registered-on-the-local-machine) – mickadoo
はい................ –
それは動作していないと思いますか? –