1 Reply Latest reply on Jun 25, 2008 7:58 AM by ch4tLock

    Database getResult() returns null

    ch4tLock
      public static function query(qstr:String):String {

      queryStmt = new SQLStatement();
      queryStmt.sqlConnection = conn;
      queryStmt.text = qstr;

      try {

      queryStmt.execute();

      var result:SQLResult = queryStmt.getResult();
      traceDebug(result);

      if (result != null) {

      var numRows:int = result.data.length;

      for (var i:int = 0; i < numRows; i++)
      {
      var output:String = "";
      for (var columnName:String in result.data )
      {
      output += columnName + ": " + result.data
      [columnName] + "; ";
      }
      }
      return output;

      } else {

      return null;
      }

      } catch (error:SQLErrorEvent) {

      traceDebug("SQL ERR: " + error.message);
      return null;
      }
      }


      _________

      I'm used Adobe Live Docs example and some little modifications but doesnt working.. getResult(); returns null in any damn condition :)

      traceDebug is my own working function.. just appends string parameter to a textfield