Writing data to on-device database

Saving the data from the form to the on-device database is very simple. Use the same key value pair to look up the correct record, change the values, commit, and close.

Writing data to on-device database
dbMgr = CreateObject("avantgo.db"); 
    dbSet = dbMgr.open("avgoEmpDir", "w"); 
    var search = dbSet.createSearch("id = " + empId); 
        if(!dbSet.find(search)) { 
            alert("Could find record " + empId); 
            window.location = "index.html"; 
            dbSet.close(); 
            return; 
        } 

        dbSet.lastname = document.updateForm.lastName.value; 
        dbSet.firstname = document.updateForm.firstName.value; 
        dbSet.phonenumber = document.updateForm.phoneNumber.value; 

        dbSet.commit();
        dbSet.close();