title: Uncaught InvalidStateError: Failed to read the 'result' property from 'IDBRequest': The request has not finished
body: <p>I need your help guys.</p>
  
  <p>I am using <code>indexedDB</code>. I need to read records from a table in the DB using <code>Javascript</code> but I am getting an error message that says from Chrome browser V52 <strong>Uncaught InvalidStateError: Failed to read the 'result' property from 'IDBRequest': The request has not finished.</strong></p>
  
  <p>Below is my Javascript code</p>
  
  <p>var db;
          var availableJobs = 0;</p>
  
  <pre><code>    window.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
  
      var request = window.indexedDB.open("MyDbName", 1);
  
      request.onsuccess = function (event) {
          db = request.result;
      }
  
      request.onblocked = function (event) {
          db = "blocked...";
      };
  
      request.onerror = function (event) {
          db = "Error...";
  
      };
  
      var objectStore = db.transaction("ActionCard").objectStore("ActionCard");
  
      objectStore.openCursor().onsuccess = function (event) {
          var cursor = event.target.result;
  
          if (cursor) {
              if (cursor.value.ActionCardStatusId == 1 || cursor.value.ActionCardStatusId == 3) {
                  availableJobs++;
              }
  
              cursor.continue();
          }
  
          $("#availableJobs").html(availableJobs);
      }
  </code></pre>
  
  <p>I am getting an error message on this line</p>
  
  <pre><code>var objectStore = db.transaction("ActionCard").objectStore("ActionCard");
  </code></pre>