0 Replies Latest reply on Feb 26, 2009 5:29 AM by Anshuen

    SQL error #3115 during Create table

    Anshuen
      As a new user to this AIR problem, I am using "adl application.xml" to start up testing.
      I am using disk file based table. Disk file is wiped out each time before startup this application.

      Following sql failed all the time. Is there anything wrong with adl or any cached data need to empty out prior to create table?

      createTables : function(callback) {
      // create tables
      var stmt = new air.SQLStatement();
      stmt.sqlConnection = this.sqlConnection;
      stmt.text = "CREATE TABLE IF NOT EXISTS Contacts ( " +
      "id INTEGER PRIMARY KEY AUTOINCREMENT, " +
      "manufacturer VARCHAR(32), " +
      "model VARCHAR(32), " +
      "sn VARCHAR(32), " +
      "orderNumber VARCHAR(64), " +
      "type VARCHAR(256), " +
      "shipping VARCHAR(32), " +
      "check VARCHAR(32), " +
      "notes VARCHAR, " +
      "photo BLOB)";

      var success = function(event) {
      if (callback) callback(true);
      };
      var failure = function(event) {

      runtime.trace("CREATE TABLE error:", event.error);
      runtime.trace("event.error.code:", event.error.code);
      runtime.trace("event.error.message:", event.error.message);

      if (callback) callback(false, event.text);
      }
      //
      stmt.addEventListener(air.SQLErrorEvent.ERROR, failure);
      stmt.addEventListener(air.SQLEvent.RESULT, success);
      stmt.execute();
      },

      D810# adl application.xml
      Loaded
      Loaded
      Loaded
      Loaded
      Loaded
      Loaded
      Loaded
      creating database D:\blackbooksafe\data\database.db
      CREATE TABLE error: SQLError: 'Error #3115: SQL Error.', details:'near 'VARCHAR'
      : syntax error', operation:'execute', detailID:'2003'
      event.error.code: undefined
      event.error.message: Error #3115: SQL Error.
      Cannot create database: Error #3115: SQL Error.
      D810#