Skip to main content
Astraport2012
Known Participant
July 7, 2011
Question

Failed to retrieve data from SQLite to Air application.

  • July 7, 2011
  • 1 reply
  • 581 views

Use a simple database and get an error: selectError SQLError: 'Error #3115: SQL Error.', details:'no such table: 'nnn'', operation:'execute', detailID:'2013'

But the table 'nnn' in the database is available. I tried several different files, create new database - no result. Code to query the database:

import flash.data.SQLConnection;
            import flash
.data.SQLStatement;
            import flash
.data.SQLResult; 
            import flash
.data.SQLMode; 
            import flash
.events.SQLErrorEvent; 
            import flash
.events.SQLEvent;    
            import flash
.filesystem.File;   

            private var conn
:SQLConnection;
            private var createStmt
:SQLStatement;
            private var insertStmt
:SQLStatement;
            private var insertStmt2
:SQLStatement;
            private var selectStmt
:SQLStatement;



            protected
function init(event:FlexEvent😞void
           
{

                var dbFile
:File = File.applicationStorageDirectory.resolvePath("ttt.db");

                conn
= new SQLConnection();
                conn
.openAsync(dbFile);
                conn
.addEventListener(SQLEvent.OPEN, openSuccess);
                conn
.addEventListener(SQLErrorEvent.ERROR, openFailure);
           
}


            protected
function openSuccess(event:SQLEvent😞void
           
{
                conn
.removeEventListener(SQLEvent.OPEN, openSuccess);
                conn
.removeEventListener(SQLErrorEvent.ERROR, openFailure);

This topic has been closed for replies.

1 reply

chris.campbell
Legend
July 11, 2011

Hi,

It looks like your code sample was truncated.  Do you mind posting the entire file again?

Thanks,

Chris