facebook

Help insert databse

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #326917 Reply

    leopan
    Member

    Hy,
    i have this problem: my app have more screens. The first is main manù, the second screen is a screen of data entry in database.
    For each instance, the first use of the app i can enter data into the database without problem, but if i go to back in menu and run the second screen (for the second time) my app don’t insert in database. I have insert my code in custom file of the menù screen (the first screen)
    We can help me?
    Thanks.

    the code of access ed insert database is this:

    Access database
    function ApriDb()
    {

    if (window.openDatabase)
    {
    db = openDatabase(“Db”, “1.0”, “Database app”, 400000);
    if (!db)
    alert(“Impossibile aprire il database del dispositivo.”);
    }
    else
    alert(“Impossibile accedere al database”);
    }

    Insert Database
    function InsertMov()
    {

    if (FlagInsertimento==true)
    {

    db.transaction(function(tx) {
    tx.executeSql(“SELECT COUNT(*) FROM Persone”, [], function(result) {
    }, function(tx, error) {
    tx.executeSql(“CREATE TABLE Persone (ID INTEGER PRIMARY KEY AUTOINCREMENT, Nome TEXT, Cognome TEXT, Indirizzo TEXT)”, [], function(result) { });
    });
    });
    db.transaction(function (tx) {
    tx.executeSql(“INSERT INTO Persone(Nome, Cognome, Indirizzo) VALUES (?, ?, ?)” , [$(‘#m1-Inserisci-Nome’).val(), $(‘#m1-Inserisci-Cognome’).val(), $(‘#m1-Inserisci-Indirizzo’).val()]);
    });
    alert(“Dati inseriti”);
    }

    }

    #326930

    Hi,

    I almost sure that your issue is the same that this post: http://www.genuitec.com/support-genuitec/viewtopic.php?f=8&t=3047

    Please see my reply and let me know if your problem with your code continues after follow my recommendations.

    #327040

    leopan
    Member

    Dear Octavio,
    this happens only with the emulator. I ran the code with the iphone and it works well

    #327063

    Hi leopan,

    Your issue is in our queue. Will inform when replicate the problem and know more about it.

    #327089

    @leopan

    I tried to replicate your issue in TC, but had not success. Could you provide the steps to replicate it? Also if you think your project will help us to find a solution please attach it to thread or send us a copy to support at genuitec dot com

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Help insert databse

You must be logged in to post in the forum log in