Hi fellas,
I'm new to Adobe Air and I have looked around and couldn't find a decent tutorial about Air and Databases.
I'm a web developer and I'm used to work with MySQL, is it possible to work with MySQL and Ar?
I have found a piece of code on documentation but its not working and the debug is not returning any errors.
<?xml version="1.0" encoding="utf-8"?><s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="init()"> <fx:Script> <![CDATA[ import flash.data.SQLConnection; import flash.data.SQLMode; import flash.events.SQLErrorEvent; import flash.events.SQLEvent; import flash.filesystem.File; private function init():void { var conn:SQLConnection = new SQLConnection(); conn.addEventListener(SQLEvent.OPEN, openHandler); conn.addEventListener(SQLErrorEvent.ERROR, errorHandler); // The database file is in the application storage directory var folder:File = File.applicationStorageDirectory; var dbFile:File = folder.resolvePath("DBSample.db"); conn.openAsync(dbFile, SQLMode.UPDATE); } private function openHandler(event:SQLEvent):void { trace("the database opened successfully"); } private function errorHandler(event:SQLErrorEvent):void { trace("Error message:", event.error.message); trace("Details:", event.error.details); } ]]> </fx:Script> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <s:Label x="147" y="51" id="mensagem"/></s:WindowedApplication>
I checked the directory said in the tutorial and did not found the .db file.
Thanks in advance for any help.