5 Replies Latest reply on Jun 22, 2009 3:59 PM by adobe_paul

    Quick Start: Working asynchronously with a local SQL database

    dbraun

      I can't get the FLA provided with this "Quick Start" tutoral to test successfully.

       

      When I test the movie I get errors:

       

      1046: Type was not found or was not a compile-time constant: SQLEvent.
      1046: Type was not found or was not a compile-time constant: SQLErrorEvent.
      etc...
       
      I tried adding import statements for those classes but still get the same errors. I am using Flash CS4 trial version.

       

      What do I need to do?

        • 1. Re: Quick Start: Working asynchronously with a local SQL database
          Joe ... Ward Level 4

          Make sure that the publish settings for the project are set to AIR.

          1 person found this helpful
          • 2. Re: Quick Start: Working asynchronously with a local SQL database
            dbraun Level 1

            Thank you. I did try that at first, but when I tested, nothing happened after the progress dialog completed.

             

            However, after I updated Flash (authoring environment), I noticed that the publish setting for AIR went from AIR  1.1 to AIR 1.5.

             

            Now it works! Tricky tricky.....

             

            One strange thing though. Why did the errors for missing SQLEvent and SQLErrorEvent go away after the update? The import statements are still missing for those classes?

             

            Is it because the code is in the timeline, rather than a class def in an .as file?

            • 3. Re: Quick Start: Working asynchronously with a local SQL database
              dbraun Level 1

              Question:

               

              I set the code in this example to, instead of writing the database to memory, write the file "DBSample.db" to hard disk.

               

              Where is this file? I can't find it in the application directory (after running the installed AIR app).

               

              I would like to know if this database file can be used by Access so that other members of the project team can take data collected from an app I write without having to use tools outside their skill set.

              • 4. Re: Quick Start: Working asynchronously with a local SQL database
                dbraun Level 1

                Heh. Found it: C:\Documents and Settings\Dan\Application Data\com.adobe.air.examples.flash.SimpleDBExampleFlash.56087B53953BC65466209BF507A92A33F9 B8499E.1\Local Store

                 

                I have to read support docs a little harder

                 

                ...and windows apparently doesn't search within hidden folders by default. Doh!

                • 5. Re: Quick Start: Working asynchronously with a local SQL database
                  adobe_paul Adobe Employee

                  That happens to be the location on your computer, since you apparently use Windows XP. The example was written to use the "application storage" directory, which is located in different places on different operating systems (and is in fact specific to each user and each AIR app).

                   

                  However, you can choose where to save the database file, and have it saved wherever you want. Just create a File object that points to the location where you want the database, and pass that File object to the SQLConnection.open() or openAsync() method.

                   

                  (Maybe you already knew that or figured it out, but I thought I'd clarify that point just for the sake of the record.)