Promotic
WikipediaLinkedInYoutubeTwitterFacebook

WriteFieldValue - method of the PmaDatabase object

Description:
Method sets the value of a single column or all columns (defined in the vField parameter) of the current row (defined for example by calling the Move method).
Syntax:
Boolean WriteFieldValue(Variant vField, Variant vValue)
Parameters:
vField(Variant) Column name of the table or its index (zero-based index). If not set, then the method writes into the whole row of the table the variable of the Array type.
If is -3 then sets the whole table row from Array of values.
vValue(Variant) The new value to be written.
Return values:
true - on success
false - on error
See also:
Example1:
JavaScriptVBScriptSelect and copy to clipboard

var oDb = pMe.Pm("/Database0");

if (oDb.IsOpen())
{
//writing into the column named "column1" and the first row of the table
oDb.MoveFirst();
oDb.WriteFieldValue("column1", 100);

//writing into the column 1st column and the 2nd row of the table
oDb.MoveNext();
oDb.WriteFieldValue(0, 100);
}
Example2:
Writing into more columns in the 1st row of the table by the Edit method.

In this case it is the better way than to call the WriteFieldValue method repeatedly without the Edit.

JavaScriptVBScriptSelect and copy to clipboard

if (oDb.IsOpen())
{
oDb.MoveFirst();
oDb.Edit();
oDb.WriteFieldValue(0, 1);
oDb.WriteFieldValue(1, 12);
oDb.WriteFieldValue(2, "Text");
oDb.Update();
}
Example3:
Writing into more columns in the first row of the table by the Array of values.
JavaScriptVBScriptSelect and copy to clipboard

if (oDb.IsOpen())
{
var arr = Pm.CreatePmArray().Array1(1, 12, "Note");
oDb.MoveFirst();
oDb.WriteFieldValue(-3, arr);
}

History:
Pm9.00.00: Created
PROMOTIC 9.0.13 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice