Load schema and access the loaded schema of database in SQLite, AIR.

December 21, 2012

As always lets do things in steps.

  1. Create necessary variables.
  2. Open connection to database file already created.
  3. Read schema from opened connection to database.

1. Create necessary variables

private var sqlConnection:SQLConnection;
private var dbFile:File;
private var sqlStatement:SQLStatement;

2. Open connection to database file already created

dbFile=new File();
dbFile=File.applicationStorageDirectory.resolvePath("myDatabase.db");

sqlConnection = new SQLConnection();
sqlConnection.addEventListener(SQLEvent.OPEN, onDBOpened);
sqlConnection.addEventListener(SQLErrorEvent.ERROR, onDBError);
sqlConnection.open(dbFile);

3. Read schema from opened connection to database
Read the rest of this entry »