RewriteObject
ODBPPLib.IODBPP.RewriteObject is used in conjunction with ReadObject to change the values of the object.DatabaseObject RewriteObject ( uint tableId );
Parameters
| tableId | The table Id defining the table's handle. |
Return Values
RewriteObject returns the DatabaseObject with the newly re-written object's values.Remarks
Example Use
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);
uint objectId = 1;
result = odbpp.ReadObject(FIRST_TABLE, odbpp.GREATER_EQUALTO, 0, objectId);
if(result != null && result.readField("First") != 123)
{
result.WriteField("First",123);
result.RewriteObject(FIRST_TABLE);
odbpp.CommitTransaction();
}
}
catch (Exception e1)
{
MessageBox.Show(e1.Message);
}
}

