// The validAdmin property is used to protect the Administrative pages
client.validAdmin == "false"
if(!database.connected())
database.connect("INFORMIX", "yourserver", "informix", "informix", "livewire")
if (!database.connected())
write("Error: Unable to connect to database.")
else {
/* Below we find the highest customer ID and store it in a
property we created called "lastID". Later, we will use
this property to find the next available unique ID that
we can use to add a new customer to the database.
Notice how we lock the project object before we modify its
properties, so we can protect it from corruption that may
occur with simultaneous accesses.
*/
project.lock()
project.lastID = 0;
cursor = database.cursor("select * from customer order by ID");
while(cursor.next())
{
project.lastID = cursor.id;
}
cursor.close();
project.unlock()
redirect("home.htm")
}