How to resolve “Could not find installable ISAM.” error for OLE DB provider “Microsoft.ACE.OLEDB.12.0”

扶醉桌前 提交于 2019-11-29 09:11:39
Sagar R

TRY this it may help you:

set path and strFileType as per requirement

      string connString = "";
//    string strFileType = Path.GetExtension(UpfileName.FileName).ToLower();
//    string path = UpfileName.PostedFile.FileName;

if (strFileType.Trim() == ".xls")
   {

      connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=2\"";
   }
   else if(strFileType.Trim() == ".xlsx")
    {
            connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=\"Excel 12.0;HDR=Yes;IMEX=2\"";
    }

I think the answer is hiding in the SSIS package info you posted. The new file format xlsx, stores the data in XML format instead of the old format. Look at it again. It reads... Extended Properties="Excel 12.0 XML;HDR=YES

Don't miss that XML after the standard stuff. (For what it's worth, I also read that you need "Excel 12.0 Macro" to connect with an xslm file.)

Give it a try. Weird but hopefully it works.

Try This

SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
                'EXCEL 12.0;DataBase=C:\TEMP\test.xlsx;Extended Properties="EXCEL 12.0 Xml;HDR=YES', [Sheet1$])
Frenk

i've resolved with this query:

SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 
    'Excel 12.0;HDR=NO;Database=D:\Filename.xlsx;', 
    [SheetName$])

It seems sql doesn't like the "Extended Properties" section...

FINALLY, a solution!

Check this out: Msg 7302, Level 16, State 1, Line 1 Cannot create an instance of OLE DB Provider “Microsoft.ACE.OLEDB.12.0” for linked server “(null)”

Basically, you go to

Control Panel > Administrative Tools > Component Services

then expand

Component Services > Computers > My Computer > DCOM Config

find

MSDAINITIALIZE

go to

Properties > Security > Launch and Activation Permissions

click on

Customize > Edit...

add your login name or "Everyone" if you prefer

tick ALL the "allow" boxes for the new user / group

and hit OK on both pages

Now see if your OpenRowSet / OpenDataSource command works

Thanks to Ramesh Babu Vavilla (vr.babu) from social.technet.microsoft.com for the link

Hai am also faced this situation i solved It

Solved

string ConeectionString = String.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + txtFlp.Text 

    + ";Extended Properties=\"Excel 12.0 Xml;HDR=YES\"");

                OleDbConnection oconn = new OleDbConnection(ConeectionString);</b>
Simon Turner

This worked for me:

SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 
   'Excel 12.0;HDR=NO;Database=C:\temp\file.xlsx;',[sheetname$])

Ensuring quotations around extended properties section of the connection string fixed it for me. I had added an additional property and didn't migrate the quote to the end after my new property.

This worked for me

Select *
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 
                'text;
                 HDR=yes;
                 imex=1;
                 driver={Microsoft text Driver (*.xls, *.xlsx, *.xlsm, *.xlsb,*.csv)}; 
                 extended properties=excel 12.0 xml; 
                 Database=<path>\', 
                'SELECT * from [<filename>#csv]')
Fernando Cifuentes Perez

If you do all this post and continue with te error. try to assign permisiton on the folder pdf, to account

NT Service\MSSQLSERVER
NT Service\SQLSERVERAGENT

works for me

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!