AS3 Error #3104: A SQLConnection must be open to perform this operation.
Description:
This AS3 error is really straight forward and easy to fix. It means that you have to open the Database before you can put anything in or take anything out. (or change anything). You cannot do any interaction with the DB without having it open. The solution is easy. Open the database before interacting with it.
Fix:
To fix AS3 Error 3104 make sure you have written this line of code dbConnection.open(dbfile); or dbConnection.openAsync(dbfile); If you have written this line of code then check where it sits in your ActionScript if it doesn’t sit above the first try-catch statement then you need to move it there. Placing the open(); call in the right place will resolve ActionScript Error 3104);
Bad Code:
try
{
statement.execute();
}
catch(error:Error)
{
trace(error.message);
}dbConnection.open(dbfile);
Good Code:
dbConnection.open(dbfile);
try
{
statement.execute();
}
catch(error:Error)
{
trace(error.message);
AS3 Error 3104 is a straight forward AS3 error message, with a very easy fix.
As always Happy Flashing
Curtis J Morley