none
Could not find installable ISAM RRS feed

  • Question

  • Hi,

    When i try to read a .csv file using my windows application i get the below error.

    Type : System.Data.OleDb.OleDbException, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c56123423    Message : Could not find installable ISAM.
        Source : Microsoft JET Database Engine
        Help link :
        ErrorCode : -2147467259
        Errors : System.Data.OleDb.OleDbErrorCollection
        Data : System.Collections.ListDictionaryInternal
        TargetSite : Boolean LoadDataFromExcel(Liberty.Framework.ExcelImport.ImportFileStruct[], System.String, System.String)

     

    I have gone through lot of forums. Most of guys did mistake in connection string syntax. But that is not the case exactly in my case. My code goes like this.

     

     

     string dataProvider = IdentifyDataProvider(filepath);

                    if (string.IsNullOrEmpty(dataProvider))
                        dataProvider = "Microsoft.Jet.OLEDB.4.0";


                    string command = string.Empty;
                    if (file.Extension.ToString().Trim() == ".csv")
                    {
                        oledbCon = "Provider=" + dataProvider + ";Data Source=\"" + file.DirectoryName + "\"; Extended Properties='text;HDR=Yes;FMT=Delimited(,)'";
                        command = string.Format("SELECT * FROM [{0}]", file.Name);
                    }
                    else if (file.Extension.ToString().Trim() == ".xls")
                    {
                        oledbCon = "Provider=" + dataProvider + ";Data Source=\"" + filepath + "\";  Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=1\"";
                    }
                    else if (file.Extension.ToString().Trim() == ".xlsx")
                        oledbCon = "Provider=" + dataProvider + ";Data Source=\"" + filepath + "\";  Extended Properties=\"Excel 12.0;HDR=Yes;IMEX=1\"";

     

     private string IdentifyDataProvider(string filePath)
            {
                //initialize objects

                System.Data.DataTable dataProvideList = null;
                string providerName = string.Empty;

                try
                {

                    using (dataProvideList = new OleDbEnumerator().GetElements())
                    {
                        foreach (DataRow dRow in dataProvideList.Rows)
                        {
                            if (dRow[0].ToString().Contains("Microsoft.ACE"))
                            {
                                if (CheckIfRegistered(dRow[0].ToString(), filePath))
                                {
                                    providerName = dRow[0].ToString();
                                    break;
                                }
                            }
                        }

                        if (string.IsNullOrEmpty(providerName))
                        {

                            foreach (DataRow dRow in dataProvideList.Rows)
                            {
                                if (dRow[0].ToString().Contains("Microsoft.Jet"))
                                {
                                    if (CheckIfRegistered(dRow[0].ToString(), filePath))
                                    {
                                        providerName = dRow[0].ToString();
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
                catch
                {
                   
                }
                return providerName;
            }

     

    My OS: Windows XP

    Office: 2003

    I suspect that OleDbEnumerator may be failed to get the correct provider. The hard coded string jet4.0 also didnt help me. Need some help on this.

     

    Thanks

    Alavudeen

     

    Thursday, July 29, 2010 9:20 AM

Answers

  • Thanks for everyone here. The issues was resolved by registering the dll mstext40.dll. Thanks a lot :)
    • Marked as answer by Ala_Q Wednesday, August 4, 2010 5:39 AM
    Wednesday, August 4, 2010 5:39 AM

All replies

  • Are you sure that connection string syntax is correct for text files? I see that you have single quotes around Extended Properties values for text files. If I am not mistaken, it should be double quotes, same as for Excel formats
    Val Mazur (MVP) http://www.xporttools.net
    Thursday, July 29, 2010 10:21 AM
    Moderator
  • Yes Val you are right. Extended properties are embedded together. It  should be like this.

      oledbCon = "Provider=" + dataProvider + ";Data Source=\"" + file.DirectoryName + "\"; Extended Properties="\"'text;HDR=Yes;FMT=Delimited(,)'"\";

    Thursday, July 29, 2010 11:25 AM
  • But this error occurs only to particular user machine. This connection string is fine here in my machine. I too have same XP and office 2003 as user has. i am suspecting his mstext40.dll but not sure.
    Friday, July 30, 2010 4:40 AM
  • I think you get the point. Since it only happens on particular machines, you could suggest to check the registry entry

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Text

     Or re-register mstext40.dll using Regsvr32.exe

    Best regards


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    Friday, July 30, 2010 9:35 AM
  • Re-register doesn't work. If i want to install jet 4.0 then do i have to uninstall the previous one that user has or just i could directly download and run it in the particular machine. If we have to uninstall the one that didn't work means what is the procedure to uninstall. 

    What is MDAC. Failure of MDAC also could be the reason for this error? How to install MDAC?

    Monday, August 2, 2010 9:28 AM
  • You cannot just register Jet, you need to install it and you do not need to un install any previous versions. You can find latest Jet installation here

    http://support.microsoft.com/kb/239114


    Val Mazur (MVP) http://www.xporttools.net
    Monday, August 2, 2010 12:58 PM
    Moderator
  • What is MDAC. could failure of MDAC also be the reason for this error? How to install MDAC if previous one is corrupted?
    • Edited by Ala_Q Tuesday, August 3, 2010 9:46 AM
    Monday, August 2, 2010 1:04 PM
  • Questioning about MDAC is irrelevant to this topic?
    Tuesday, August 3, 2010 9:45 AM
  • MDAC (Microsoft Data Access Components) is a set of components that includec ODBC drivers and OLEDB providers and other supporting DLL files and it is part of operating system and it is not a separate installation anymore. You could find information about MDAC installation for older versions here

    http://msdn.microsoft.com/en-us/library/ms810805.aspx


    Val Mazur (MVP) http://www.xporttools.net
    Tuesday, August 3, 2010 10:30 AM
    Moderator
  • Questioning about MDAC is irrelevant to this topic?


    At one time MDAC included the Jet database engine components but this is no longer the case. The Jet database components are a separate install and not related to MDAC.

    I would post the current connection string you are using for text files. As Val pointed out in a previous message the connection string in your posted code was incorrect. Also, for a comma delimited file the FMT argument is unnecessary.

     


    Paul ~~~~ Microsoft MVP (Visual Basic)
    Tuesday, August 3, 2010 1:12 PM
  • Thanks for everyone here. The issues was resolved by registering the dll mstext40.dll. Thanks a lot :)
    • Marked as answer by Ala_Q Wednesday, August 4, 2010 5:39 AM
    Wednesday, August 4, 2010 5:39 AM
  • As mstext40.dll and msexcl40.dll in Jet databage engine, what dll will be used if office 2007 is installed i.e Microsoft.ACE.Oldbd. I tried in the system32 folder, couldnt find one.
    Thursday, August 5, 2010 3:38 PM
  • I believe all the extensions for ACEOLEDB.DLL  are located under Program Files\Common Files\Microsoft Shared\Office1X, where 1X is the version number.

    Paul ~~~~ Microsoft MVP (Visual Basic)
    Thursday, August 5, 2010 5:10 PM