When i try to read data from .xlsx, that time its given me the following error.
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
i have used following connection string and also Provider=Microsoft.ACE.OLEDB.12.0 has been installed on server.if (strFileType.Trim() == ".xls")
{
connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + strNewPath + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=2\"";
}
else if (strFileType.Trim() == ".xlsx")
{
connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + strNewPath + ";Extended Properties=\"Excel 12.0;HDR=Yes;IMEX=2\"";
}
If any one know about this error please help me.
Thanks

Suthish NairRank #92 · 22.8K reputationPosted Feb 1, 2011, 9:12 AM EST
try, changing the advanced compile configuration to x86 found in the programs properties if your running 64 bit system.
Sam HobbsRank #107 · 20.5K reputationPosted Feb 1, 2011, 12:01 PM EST
Years ago, Microsoft decided they wanted to discontinue support of some databases such as Access. I forget if that includes OLEDB for Excel but I think so. So they did not create 64-bit versions and we had to use 32-bit applications for the databases. The amount of protest from customers was great enough that Microsoft gave in (like as Hosni Mubarak has done?) and they have provided 64-bit versions. So you have two choices; either look for a 64-bit version of OLEDB or (as Suthish suggests) make your application 32-bit.
vijay42 reputationPosted Feb 2, 2011, 4:30 AM EST
When i try to read data from .xlsx, that time its given me the following error.
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
i have used following connection string and also Provider=Microsoft.ACE.OLEDB.12.0 has been installed on server.if (strFileType.Trim() == ".xls")
{
connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + strNewPath + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=2\"";
}
else if (strFileType.Trim() == ".xlsx")
{
connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + strNewPath + ";Extended Properties=\"Excel 12.0;HDR=Yes;IMEX=2\"";
}
is there need to add references?
If Yes then may i need to add which references?
If No then how can i resolve it?
If any one know solution of this issue so please help me .
Thnaks ,
vijay
Suthish NairRank #92 · 22.8K reputationPosted Feb 2, 2011, 5:31 AM EST
same code not working on your system?
Suthish NairRank #92 · 22.8K reputationPosted Feb 4, 2011, 9:20 AM EST
So other members can easily find the answers.