On Jan 26, 2006, at 12:32 PM, Echo wrote:
I am trying to insert some data into a table I just made. I get an
exception when I try to do a cur.save(). The exception I get is "No
data to save". Is there something I am missing or doing wrong?
Yes. You are inserting the records into the database directly,
rather than adding them to the cursor's local data store. save() is
designed to take changes to the cursor's local data store and write
them back to the database. Since you bypassed the local data store,
there was nothing for the cursor to save.
If you work directly with the cursor, you call cursor.new() to
create a new, blank record, and then populate the fields using
setFieldVal(fld, val). I usually prefer working with business
objects, since I can call:
bizobj.new()
bizobj.field1 = "Foo"
bizobj.field2 = "Bar"
bizobj.save()
-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users