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 NairPosted Feb 4, 2011, 2:20 PM
So other members can easily find the answers.
Suthish NairPosted Feb 2, 2011, 10:31 AM
same code not working on your system?
vijayPosted Feb 2, 2011, 9:30 AM
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
Sam HobbsPosted Feb 1, 2011, 5:01 PM
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.
Suthish NairPosted Feb 1, 2011, 2:12 PM
try, changing the advanced compile configuration to x86 found in the programs properties if your running 64 bit system.