title: Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)"
body: <p>I got an error like this</p>
  
  <p>'Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".
  OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" returned message "Could not find installable ISAM.".' while transferring database from msaccess to SQL</p>
  
  <p>I have written this code</p>
  
  <pre><code>try
  {
      DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.OleDb");
      DataTable userTables = null;
      using (connection)
      {
         string mappath = dataGridView1.CurrentRow.Cells["Path"].Value.ToString();
         string[] filePaths = Directory.GetFiles(@"" + mappath + "", "*.mdb", SearchOption.TopDirectoryOnly);
         // c:\test\test.mdb
         foreach (string tr in filePaths)
         {
            connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + tr + "";
            string[] restrictions = new string[4];
            restrictions[3] = "Table";
            connection.Open();
            userTables = connection.GetSchema("Tables", restrictions);
            List&lt;string&gt; tableNames = new List&lt;string&gt;();
            for (int i = 0; i &lt; userTables.Rows.Count; i++)
               tableNames.Add(userTables.Rows[i][2].ToString());
            try
            {
               foreach (string tableName in tableNames)
               {
                  cn1 = new SqlConnection(con);
                  if (cn1.State != ConnectionState.Open) { cn1.Open(); }
                  SqlCommand cmd = new SqlCommand("select * into [" + tableName + "] from OPENROWSET('Microsoft.Jet.OLEDB.4.0','" + tr + "',[" + tableName + "])");
                  cmd.Connection = cn1;
                  cmd.ExecuteNonQuery();---Got error Here
               }
            }
            catch (Exception Ex) { connection.Close(); }
            connection.Close();
         }
      }
   }
   catch (Exception Ex) { }
  </code></pre>
  
  <p>Would you pls solve this error</p>