How can I read data from my SQLite database?

I am new to Adobe Air and am playing with creating something simple to insert data into a database and then display it. I was able to insert data successfully but now encounter difficulties to read from the database and display. How can I display data such as a text box or text box?

This my code for insertion:

private void sqlConn(dbName___tring,_dbstmt___tring,_dbInsert___tring):void
{
sqlC varQLConnection = new SqlConnection ();
SQLs varQLStatement = new SQLStatement();
SQLI varQLStatement = new SQLStatement();

file: var folder = File.applicationDirectory;
var dbPath:File = folder.resolvePath (dbName);

sqlc.addEventListener (SQLEvent.OPEN, dbCreated);
sqlc.addEventListener (SQLErrorEvent.ERROR, dbError);

sqls.addEventListener (SQLEvent.RESULT, tbCreated);
sqls.addEventListener (SQLErrorEvent.ERROR, tbError);

sqli.addEventListener (SQLEvent.RESULT, recCreated);
sqli.addEventListener (SQLErrorEvent.ERROR, recError);

sqlc.openAsync (dbPath);

sqls.sqlConnection = sqlc;
SQLs. Text = dbstmt;
SQLs. Execute();

sqli.sqlConnection = sqlc;
SQLI. Text = dbInsert;
SQLI. Execute();
}

private void btn_Click (): void
{
dbName var= "test.db" tring
var sqlStatmttring = "CREATE TABLE If NOT EXISTS test_table (id INTEGER PRIMARY KEY AUTOINCREMENT, first_name TEXT, last_name TEXT);
var sqlInserttring = 'INSERT test_table (first_name, last_name) VALUES('"+txtTaskName.text+"','"+txtTaskDescription.text+"');';
var sqlReadtring = "SELECT * FROM test_table;"

sqlConn (dbName, sqlStatmt, sqlInsert);
}

That's what I have so far to read the articles. Is this right? How can I use it to display items on one of my opinions?

private void readItems(dbName___tring):void
{
var sqlrQLStatement = new SQLStatement();
sqlC varQLConnection = new SqlConnection ();
file: var folder = File.applicationDirectory;
var dbPath:File = folder.resolvePath (dbName);

sqlc.openAsync (dbPath);

sqlr.addEventListener (SQLEvent.RESULT, recFound);
sqlr.addEventListener (SQLErrorEvent.ERROR, recFoundError);

sqlr.sqlConnection = sqlc;
sqlr. Text = "SELECT * FROM test_table ';
sqlr. Execute();

Table of results: var = sqlr.getResult () .data;
}

Thank you

They must be in their own class and each class must be in their own folder. If you need a taskClass.as file and a SQLClass in the SQLClass.as file that has the recFound function.

Tags: BlackBerry Developers

Similar Questions

  • How can I download data from key USB flash to a Windows 7 computer

    I need to transfer some files from my PC to my PC Windows 7 Windows XP using a USB flash key. I've used Windows Easy Transfer to move my files without problem and some programs but did not download some files. I downloaded these files on a USB flash and I can access the files, as long as the stick is pluged. How can I download data from the USB flash on my Windows 7 computer

    Hello

    The following video may help:

    http://www.YouTube.com/watch?v=hrMQh0Xkpvs

    or this article:

    http://www.swarthmore.edu/documents/administration/its/how%20To%20Use%20A%20USB%20Flash%20Drive.PDF

    and here:

    http://TECHTIPS.salon.com/use-USB-flash-drive-transfer-files-PC-Mac-2544.html

    (Mac here can be a PC).

    Good luck.

  • How can I get data from each associated XMLnode in movieclips separated when you click a line in the combobox

    How can I get data from each associated XMLnode in movieclips separated when you click a line in the combobox?

    A sample of XML is like this:

    <>planter

    < Lauvtre >

    < Botanisk_navn > Acer campestre < / Botanisk_navn >

    < Norsk_navn > Naverlonn < / Norsk_navn >

    Gronn < Farge > < / fan >

    H4 < Herdighet > < / Herdighet >

    < Hoyde > 10-15 m < / Hoyde >

    < / Lauvtre >

    I have a combobox where it shows the botanical name and the Norwegian name. But the rest of the info in movieclips seem separate.

    Someone has an idea how to do this? Can I use the trace function maybe? Here is my AS3 code so far:

    var loader: URLLoader = new URLLoader();

    loader.addEventListener (Event.COMPLETE, onLoaded);

    list.addEventListener (Event.CHANGE, itemChange);

    function itemChange(e:Event):void

    {

    your. Text = list.selectedItem.data;

    TB. Text = list.selectedItem.label;

    }

    var xml;

    function onLoaded(e:Event):void

    {

    XML = new XML (e.target.data);

    var it: XMLList = xml. Planter.Lauvtre;

    for (var i: uint = 0; i < il.length (); i ++)

    {

    list.addItem ({data: it.}) Farge.Text ([i]) + "\n"+ it.» Herdighet.Text ([i]) + "\n" + it. Hoyde.text ([i]),

    label: it. Botanisk_navn. Text() [i] + "\n"+ it.» Norsk_navn. Text() [i]});

    }

    }

    Loader.Load (new URLRequest ("lauvtre.xml"));

    Thank you!

    Rheus.

    I don't know what you're trying to do.  but, if you want to fill one combobox with the botanical names and when one is chosen, the other use of logins:

    var loader: URLLoader = new URLLoader();

    loader.addEventListener (Event.COMPLETE, onLoaded);

    list.addEventListener (Event.CHANGE, itemChange);

    function itemChange(e:Event):void {}

    var selectedObj:Object = a [list.selectedIndex]

    trace (selectedObj ['fan'], selectedObj ['Botanisk'], etc);

    }

    var xml;

    var a: Array = [];

    function onLoaded(e:Event):void {}

    XML = new XML (e.target.data);

    var it: XMLList = xml. Lauvtre;

    for (var i: uint = 0; i

    list.addItem({label:il[i].child('Botanisk_navn').toString()});)

    a [i] = {'Fan': it [i].child('Farge').toString (), 'Herdighet': it [i].child('Herdighet').toString (), "Hoyde": he [i].child('Hoyde').toString (), 'Botanisk':il[i].child('Botanisk_navn').toString(),'Norsk_navn':il[i].child('Norsk_navn').toString()};}

    }

    }

    Loader.Load (new URLRequest ("test.xml"));

  • How can I transfer data from the database in a variable (or array)?

    I made my request according to the example (http://corlan.org/2009/06/12/working-in-flash-builder-4-with-flex-and-php/). Everything works fine. I changed a single function to query the database - add two parameters and get the value from the table to a string format. A test operation shows that everything is ok. If I want to display this value in the text box, I just do drag and drop off service to this element in Design view

    (< s:TextArea = "153" x = "435" id = "nameText" text = "{getDataMeanResult.lastResult [0] .name}" width = "296" height = "89" / > ").

    Also, it works fine, just a warning and encouraged to use ArrayCollection.getItemAt ().

    Now, I want to send the value to a variable or an array, but in both cases, I get an error: TypeError: Error #1010: a term is undefined and has no property..

    How can I pass a value to the database in a variable? Thank you.

    public var nameTemp:String;

    getDataMeanResult.token = authors.getDataMean (arrayOfNumber [0], dir_id);

    nameTemp = getDataMeanResult.lastResult [0] .name;

    public var nameArray:Array = new Array();

    for (var i: uint = o; i < 3; i ++) {}

    getDataMeanResult.token = authors.getDataMean (arrayOfNumber [i], dir_id);

    NomTableau [i] = getDataMeanResult.lastResult [0] .name;

    }

    And how do I use syntax highlighting in this forum?

    Astraport2012 wrote:

    Thank you.

    Then this simple question: How can I place a mySQL database data in a variable using the wizards FB4 (connect with PHP)?

    If you can show examples please.

    I couldn't find examples. Send data to a field text or DataGrid - much, but no variable.

    the use of assistants? not sure... it is generally a bad idea to rely on them, because they will never fully what you want anyway. I would recommend learning abit of PHP and manage by yourself, because it allows you to manage everything exactly as you wish.

    small example of communicating with a database using PHP + FB4:

    mount a database

    write you a small script that will access your database, get a value, for example:

    ";
    
        while($row = mysql_fetch_array($result))
        {
            if($row['messageID'] == "3")
            {
                print $row['message'];
            }
        }
        print "\n";
    ?>
    

    This will get the message with ID '3 '.

    make an HTTPService in FB4 app to call this Script, as follows:

    
    
        
            
    
            
        
    
        
            
        
        
    
    
    

    and the value must be picked up by the Script and properly stored in a variable

  • read data from a SQL database

    Hi all

    who can I load data from a database, based on a specific query and data in a string or an integer in cascades please give example

    Thank you

    for example first element of data

    // dd
    data[0].dd
    data[0].mm
    etc...
    

    If you put the data to GroupDataModel for example. Then you can access it with ListItemComponent like this:

    ListItemData.dd
    ListItemData.mm
    etc...
    
  • How can I recover data from a disk that has been done under windows xp with the new computer that is running windows 7?

    My drive has been created using a windows xp windows live care and my new computer works with windows 7. How can I get information on the new computer. When I tried to download the software of microsoft it would allow me to do. Any ideas?

    Hi Dorene33,

    ·         What exactly happens when you try to download the software?

    ·         You receive an error message?

    ·         You are able to access drive from devices and printers?

    ·         What happens exactly when you double click on the drive and try to open it?

    I suggest that you scan your computer with the Microsoft Security Scanner, which would help us to get rid of viruses, spyware and other malware

    The Microsoft Security Scanner is a downloadable security tool for free which allows analysis at the application and helps remove viruses, spyware and other malware. It works with your current antivirus software.

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    Note: The Microsoft Safety Scanner ends 10 days after being downloaded. To restart a scan with the latest definitions of anti-malware, download and run the Microsoft Safety Scanner again.

    Important: While running scan on the hard drive if bad sectors are found on the hard drive when scanning try to repair this area if all available on which data may be lost.

    Hope this information helps.

  • How can I export data from table to file

    Is probably a stupid question, but I have not found any KM to read a SQL server table and load its files into a text file.
    Could someone explain to me how can I do?
    Thank you

    You can use the ODISQLUnload tool. This will extract all the data in a file with the format specified in the tool.
    -in fact, if there is a large volume, I would be tempted to use a bcp command to do so. This could be in a procedure. You could get the bcp command format and a few hints on how to make generic km here
    Craig

  • How can I read/write from/to a USB in LabVIEW

    I read through a number of tutorials and help information, but I can't seem to find a way to do it.

    I created a driver for LabVIEW to recognize the USB and I can find it using the 'VISA Interactive Control', but which is as far as I can get.

    How can I simply write a small file on the USB key and read the same file back? I'm just trying to make the verification tests.

    (via LV2009)

    Thank you

    I don't understand why you're messing around with VISA. When a USB drive is connected to a pc, normal windows driver will be appear as an extra disk and you can write and read it with the regular file IO functions. He has held several positions on the detection of the indicator of new road.

  • How can I transfer data from a dead laptop

    I have a laptop medion dead that took Vista. How can I access the data and transfer it on an Asus running windows 7 64 bit

    If the Medion no will power, you can test the drive with the disk manufacturer utility.

    If the Medion does not supply power to the top, the only way is to remove the disc, put it in an envelope and see if it works.

    If it's an old record, you will probably need a powered external envelope. Older readers need too to work a single USB connection.

  • How can I insert data from another table into a table containing a timestamp column

    How you insert data from another table in a table if the target table contains a timestamp column. I tried to set the default value of GETDATE() column in the target table, but it does not work.


    I use MS SQL

    Sorry, I managed to get around this by inserting null as the value

  • How can I get data from child form

    Hello.
    IM an adapter to get the data in the main form based on the Instance of coding key.
    using this piece of code, I can get all the data in the main form.

    String response = "";
    formData tcResultSet = formIntf.getProcessFormData (Key);

    * if (formData.getTotalRowCount ()! = 0) {*}
    String [] columns = formData.getColumnNames ();
    * for (int i = 0; i < columns.length; i ++) {*}
    * response = response + columns [i] + '=' + formData.getStringValue (columns) + "\n";* ".
    *}*
    *}*

    Anyone know how to make data on child of forms?

    Thank you.

    Hello

    Try the following code:

    tcFormInstanceOperationsIntf tcforminstanceoperationsintf = apiFactory.getUtility ("Thor.API.Operations.tcFormInstanceOperationsIntf") (tcFormInstanceOperationsIntf);

    tcResultSet procChildFormDef = tcforminstanceoperationsintf.getChildFormDefinition (tcforminstanceoperationsintf.getProcessFormDefinitionKey (procInstKey), tcforminstanceoperationsintf.getProcessFormVersion (procInstKey));

    procChildFormDef.goToRow (0);

    long procChildInstKey = procChildFormDef.getLongValue ('Structure Utility.Child Tables.Child Key');

    tcChildResultSet = tcforminstanceoperationsintf.getProcessFormChildData (procChildInstKey, procInstKey);

    From there, you will get the child form result for the data set, you can loop and get the data you want.

    Hope this helps.

    Thank you best regards &,.
    Ankit

  • How can I delete data from a second hand phone?

    My son gave me his old iPhone and I added my sim card but I see its contacts and data, how to go on the withdrawal of its data and addition of mine?

    Here you can find useful information How to erase your device iOS and then set it up as a new device or restore backups - Apple Support

  • How can I import data from history, including the time of the on-site visit?

    When I opened my "History" tab, I can then select in the left column, for example "in the course of the last seven days' and then select 'Copy' in the tab 'organize '. But when I paste it into an Excel worksheet, the only information that appears is the Web site. Is it possible to import also the column "date of visit?

    You will need to use an extension like SQLite Manager to export history to CSV.

    You can add more columns if necessary.

  • How can I compare data from a set of values in a text box?

    I want to paste a series of numbers in a text box and use it to query the active column of numbers in a report to return only the assets including the active number is in the text box to know how to do this?

    If your text box contains the values concatenated to a string (: or; or, or another) you can use it in a query by replacing ":" with your string concatenation, similar to this example:

    SELECT empno, ename, job, mgr, sal
      FROM emp
     WHERE INSTR (':' || :p138_empno_textbox || ':', ':' || empno || ':') > 0
    

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    -------------------------------------------------------------------

  • How can I recover data from a disk that does not open?

    It is connected to a USB port, it is turned on, indicated on the workstation dialog box and the wizard says that it works correctly, but no data can be retrieved. It is a 500 GB NOONTEC external drive.

    Hi Joe Barna,

    If please see this thread and follow the troubleshooting steps listed by Syed N.

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-hardware/Windows-7-says-my-external-hard-drive-is-empty-but/b756d646-936a-E011-8dfc-68b599b31bf5?msgId=68f65ecd-096b-E011-8dfc-68b599b31bf5

    As long as these files are not damaged or infected by a virus or malware, there was no damage on the new computer. I think that the files could just be hidden or something like that. Just reply with the results of the steps listed above.

    I hope this helps.

Maybe you are looking for

  • unknown plugin

    Some plugins are marked as unknown when checking for the correct versions, do I have to remove them.

  • Safari 9.1 does not not Google maps

    put simply, I get a white page that loads anything more than "Google Maps" and nothing more.  It is on a Web site that uses google and maps.  Firefox, the fine support. Any ideas people? cheers in advance

  • Folio-13 2000: bypass the bios password on Folio 13-2000

    I don't know my password for the BIOS.  After that 3 attempts I get system is off and the code is 51469928.  It is a Folio 13 running Windows 7

  • Using events QNX in the AIR for BB10 in Flash Professional 5.5

    I want to use the QNX events in my AIR for BB10 application in Flash Professional. As the playbook, am I supposed to add a few swc files in order to use the events I get compilation error? I want to use "CardCloseEvent", but it gives compile error. T

  • 3.5 "hard drive USB enclosure files is not accessible?

    Recently, I changed my system hardware. Got a new motherboard that does not have an IDE socket. My previous 3.5 "IDE drive HARD internal cannot be plugged into it. So, I bought a USB (external drive enclosure HARD desktop) box for my old HDD. The uni