In the sample employee db, the new employee entries are flagged with a
negative integer for an ID within the DB. They are then displayed on the
index.html since they are now in the local DB of employees. I modified
index.html to also display the ID for each employee, which properly marks
new entries with a negative ID.

The problem is that when now updating the entry, this bit of code fails:

dbMgr = CreateObject("avantgo.db");

dbSet ="avgoEmpDir", "r");


// search for the correct record, return to the

// list on an error

var criteria = "id = " + empId;

var search = dbSet.createSearch(criteria);

if(!dbSet.find(search)) {

alert("Could find record: " + empId + " via " + criteria);


window.location = "/EmpDir/index.html";



If empId is positive or 0, the query executes correctly, if the empId is
negative, it fails. The XSD provided in the sample app is unmodified.

Is there a better practice now realized for maintaining new PKeys on the DB?


Jacob Hookom

McKesson Medical-Surgical