1 Reply Latest reply on Mar 10, 2008 10:33 PM by anirudhs

    SQLConnection Syntax

    tofudabeast
      Hello everybody, I'm following the documentation at this page, trying to get an AIR app to store data in a local SQLite db. Unfortunately, I can't even get past trying to get the example code to work! Here is a URL to what I'm trying to use.

      http://livedocs.adobe.com/flex/3/html/help.html?content=SQL_01.html

      Here's the code:

      7 import flash.events.SQLErrorEvent;
      8 import flash.events.SQLEvent;
      9 import flash.filesystem.File;
      10 import flash.data.SQLConnection;
      11
      12 var connec:SQLConnection = new SQLConnection();
      13 conn.addEventListener(SQLEvent.OPEN, openHandler);
      14 conn.addEventListener(SQLErrorEvent.ERROR, errorHandler);
      15
      16 var dbFile:File = File.applicationStorageDirectory.resolvePath("DBSample.db");
      17
      18 conn.open(dbFile);

      1120: Access of undefined property conn. SQLTest/src SQLTest.mxml line 13
      1120: Access of undefined property conn. SQLTest/src SQLTest.mxml line 14
      1120: Access of undefined property conn. SQLTest/src SQLTest.mxml line 18
      1120: Access of undefined property dbFile. SQLTest/src SQLTest.mxml line 18
      1120: Access of undefined property errorHandler. SQLTest/src SQLTest.mxml line 14
      1120: Access of undefined property openHandler. SQLTest/src SQLTest.mxml line 13


      This tiny little bit of code produces about 6 errors, all of which are telling me that I'm trying to access undefined properties of the variable conn, which should be the pointer to the SQLConnection. This is my first AIR application, and I'm kinda lost as to what to do here.