0 Replies Latest reply on May 12, 2011 1:24 PM by CSFORM_31

    Air Sqlite data paging (Cannot access a property or method of a null object reference.)

    CSFORM_31

      I want to paging this data from my table but i get this error:

      TypeError: Error #1009: Cannot access a property or method of a null object reference.


      public function retrieveData():void
      {
          var stmt
      :SQLStatement = new SQLStatement();
          stmt
      .sqlConnection = sqlConn;
          sqlConn
      .addEventListener(SQLErrorEvent.ERROR, errorHandler);
          stmt
      .addEventListener(SQLEvent.RESULT, selectResult);
          stmt
      .text = "SELECT * FROM empleado";
          stmt
      .execute(2);
          var result
      :SQLResult = stmt.getResult();
          acEmpleados
      = new ArrayCollection(result.data);
      }



      private
      function selectResult(event:SQLEvent):void
      {
          var stmt
      :SQLStatement = new SQLStatement();
          stmt
      .sqlConnection = sqlConn;
          var result
      :SQLResult = stmt.getResult();
         
      if (result.data != null)
         
      {  
             
      if (!result.complete)
             
      {
                  stmt
      .next(2);
             
      }
             
      else
             
      {
                  stmt
      .removeEventListener(SQLEvent.RESULT, selectResult);
             
      }
         
      }
      }

       

       

      What do i have to do?