AddObject
ODBPPLib.IODBPP.AddObject adds the object currently handled by a table, using NewObject if there is not currently an object.ODBPPLib.DatabaseObject AddObject ( unsigned int tableId, long Id64 );
Parameters
tableID | the table Id defining the table's handle. |
Id64 | the ID required for the new object, 0 for the next available. |
Return Values
AddObject returns the DatabaseObject with the newly added object's values.Remarks
Example Use
- C#
public static uint FIRST_TABLE = 1; private void button1_Click(object sender, EventArgs e){ try{ ODBPPLib.ODBPP odbpp = new ODBPPLib.ODBPP(); odbpp.OpenDatabase("C:\\My\\Database\\Control\\File.odc"); odbpp.BeginTransaction(odbpp.SHARED, 60000); odbpp.OpenTable(FIRST_TABLE); ODBPPLib.DatabaseObject obj = odbpp.NewObject(FIRST_TABLE); obj.WriteField("First", 456); obj.WriteField("Second", 456.789); odbpp.AddObject(FIRST_TABLE,0); odbpp.CommitTransaction(true); odbpp.EndTransaction(); } catch (Exception e1){ MessageBox.Show(e1.Message); } }
Also See
DeleteObject, NewObject, ReadObject, RestoreObject, RewriteObjectListen All
Comments (0)