Entries Tagged as 'AIR'

BACFUG - Tour De ColdFusion Contribution Night

Last Wednesday at BACFUG (Bay Area ColdFusion User Group), we hosted a Tour De ColdFusion contribution night.  If you haven't heard of Tour De ColdFusion, it is a Flex/AIR app built by Adobe to show case code examples for ColdFusion.

Read more...

On Flash - the reports of it's death are exaggerated

Write once, run across all devices is dead for now, but Flash certainly isn't.

Read more...

Select Statement using LIKE with SQL Lite in an AIR Application

Working on an AIR project with the local SQLLite database I created a search interface that required a LIKE operator for my SQL statement. Normally, it's not a big deal. I would put some single quotes with percent symbols as wild card around my search parameter.

 

It took a bit of searching to find out the correct syntax with SQL Lite for the AIR application. See below.

 

SELECT *
FROM tblFruit
WHERE (tblFruit.label) LIKE '%' || @SEARCHTEXT || '%'

 

I've created a project file which demonstrates the above code.

 

Download flex project here.

 

Aren't sure how to import this into your flex workspace? I've written a post about that as well.

 

How to bring an existing Flex / AIR project into your FlexBuilder workspace.

Learning Flex can be a challenge and I've found looking at sample code that demonstrates a technique very helpful. You've found a good example, but how to move it into your work space.

 

Here are the steps.

 

  1. Download the flex project (i.e. samplecode.zip).
  2. Open FlexBuilder.
  3. Select File > Import > Flex Project.
  4. Next to "archive file" click the browse button and locate the zipped flex project on your hard drive.
  5. You may want to change the Project Location. For example to your web root if you are running server code. Of course this may be unnecessary for sample code you are learning from.
  6. Click the Finish button.

 

Now you can open and run the sample code, pick it apart and take that next step as a Flex developer.

 

SQLError: Error #3129: The database schema changed with Flex and AIR SQL Lite Database

This error occures when you create new tables and then try to insert, select, etc during the same database connection.

 

Adobe has it listed on their runtime errors page.

 

3129 The database schema changed. Indicates that the operation could not be completed because of a schema error. This occurs when the schema of the database changes after a statement is prepared but before it finishes executing, such as if two SQLConnection instances are connected to the same database, and one instance changes the schema while another one is reading it.

 

The solution is to use the .close() method. For example. SomeSQLLiteDB.close() should be the last statement after creating your new tables. Then use SomeSQLLiteDB.open() before your insert, select, etc statement is executed.

 

The solution is to call the .close() method when you complete creating your tables. Then you can call the .connect() method and select, insert, etc from the newly created tables.

SomeSQLLiteDB.close()

SomeSQLLiteDB.connect()

 

 

Powered by Mango Blog. Design and Icons by N.Design Studio
RSS Feeds