WriteField

ODBPPLib.IDatabaseObject.WriteField writes data fields from the DatabaseObject obtained by ReadObject or DeleteObject.
void WriteField(
   string name,
   object newVal
);
void ReadFixed(
   uint field,
   object newVal
);
void ReadSubField(
   string subTable,
   uint row,
   string name,
   object newVal
);
void ReadSubTable(
   uint subTable,
   uint row,
   uint field,
   object newVal
);
void ReadVariable(
   uint field,
   object newVal
);

Parameters

namethe name of the desired field to access.
fieldthe index number of the desired field to access, starting from zero (0).
rowthe index number or name of the desired sub-table row to access, starting from zero (0).
subTablethe index number of the desired sub-table field to access.
newValthe object (variant) value that is to be written to the object.

Return Values

ReadField returns the object (variant) with the current field value.

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);
      result = odbpp.ReadObject(FIRST_TABLE, odbpp.EQUAL_TO, 0, 123);
      if(result != null){
         result.writeField("First",123);
         odbpp.CommitTransaction(true);
      }
   }
   catch (Exception e1)
   {
      MessageBox.Show(e1.Message);
   }
}

Also See

AddObject, DeleteObject, NewObject, ReadField, ReadObject, RewriteObject, RestoreObject
Comments (0)Listen All
Characters left: 2500
 

Contact Ekky Software

Thank you for your time and interest.
Ekky Software Customer Support Team.

Ekky Software Product Range
Ekky Software Homepage Ekky Software Homepage ObjectDatabase++ TScript Ekky Software Homepage Ekky Software Homepage ObjectDatabase++ TScript