PDA

View Full Version : local database problem


dieyana
02-24-2009, 09:23 AM
hye...could someone tell me what's wrong with this code??
i try to debug it and here the error statement stated:

Error: Error #3104: A SQLConnection must be open to perform this operation.
at Error$/throwError()
at flash.data::SQLStatement/checkAllowed()
at flash.data::SQLStatement/checkReady()
at flash.data::SQLStatement/execute()
at database/createRecord()[C:\Documents and Settings\database.mxml:38]
at database/___database_Button1_click()[C:\Documents and Settings\database.mxml:46]

and here is my database code:in attachment

thanks in advance....

evride
02-24-2009, 12:49 PM
try leaving out the SLQMode.

sqlConn.open(sqlFile);

evride
02-24-2009, 12:50 PM
I would also suggest you learn how to use parameters on your SQLStatements

dieyana
02-25-2009, 08:12 AM
hye...could someone help me....

i have alter my code accordingly but i still get the same error message "Error: Error #3104: A SQLConnection must be open to perform this operation.
at Error$/throwError()" .it make me frustrated....

can someone tell me what is worng with this code(in attachment) or should i install or configure something to make it work?

thanks for your time...

evride
03-03-2009, 07:29 AM
ah i remembered how to do it. lol. haven't programmed for AIR in awhile.

You've got to make sure the database is actually open. You need to use openAsync and use listeners to see when the database is actually open before running statements.
or you open databases synchronously and use try{}finally{} executing the statements inside of the finally{}