Ultrashock Forums > Flash > AIR
SQLEvent not triggered when querying an empty table

You are currently viewing our website as a guest which gives you limited access to forums, files and other resources.

Click here to join now for free, and start interacting with our members, download files and much more!

Click here if you are looking for our Flash files and other professional assets.
 
Post Reply | View first unread | Rate Thread Search this Thread | Thread Tools | Display Modes

#1
Bookmark and Share!
SQLEvent not triggered when querying an empty table
Old 2009-07-02

Hello,
I am working on an AIR application that uses an SQLite database. Everything has been going smooth except:
When I execute a query on an empty table, such as "SELECT * FROM users" when `users` is still an empty table (first launch) I don't get an event for SQLEvent.RESULT or SQLErrorEvent.ERROR, how can I listen for a response to a query that returns empty? I am trying to determine if the user has set an account, and if not, prompt them to on first launch.


Code:
protected function query(queryStr:String):SQLStatement
{
	var sqlStatement:SQLStatement = new SQLStatement();
	sqlStatement.addEventListener(SQLEvent.RESULT, handleQueryResult);
	sqlStatement.addEventListener(SQLErrorEvent.ERROR,handleSQLError);
	sqlStatement.sqlConnection = sqlConnection;
	sqlStatement.text = queryStr;
	sqlStatement.execute();
	
	return sqlStatement;
}
thanks in advance
postbit arrow Be the first to comment! | 214 views postbit arrow Reply: with Quote   
Registered User
haptic is offline
seperator
Posts: 38
2004-10-08
seperator
Thread Tools
Display Modes Rate This Thread
Rate This Thread: