![background image](http://html1.mh-extra.com/html/omron/cx-supervisor-script-reference-rev2-0/cx-supervisor-script-reference-rev2-0_reference-manual_744212124.webp)
OMRON
CHAPTER 6 – Functions and Methods
Revision 2.0
Page 111
Syntax
returnstate = DBAddNew(level)
Remarks
Argument
Type
Description
returnstate
bool
1 if the function is successful otherwise 0
level
text
A text point or constant specifying the connection level. This
should be a field or recordset level.
Typical Examples
Result = DBAddNew("Northwind.Order Details")
Using a Recordset connection level, a new record is added with values from all fields associated with
a property type ‘Add’. Point 'Result' is set true if this was successful.
DBAddNew("Northwind.Order Details.OrderID")
DBAddNew("Northwind.Order Details.ProductID")
DBAddNew("Northwind.Order Details.Quantity")
DBAddNew("Northwind.Order Details.UnitPrice")
DBUpdate("Northwind.Order Details")
Using a Field connection level, each required field is added to the new record using multiple calls to
DBAddNew(). When the record is complete, it is added by calling the DBUpdate() function
Note:
To use DBAddNew() with a Recordset level the Recordset must be configured to
perform this type of operation i.e. it will need to contain fields for any primary keys
and ‘non null’ values required to create a new record. When used at Recordset level all
fields associated with the Recordset with property type ‘Add’ are added (as if calling
DBAddNew()) and the record is updated (as if calling DBUpdate()). Points associated
with the ‘Add’ property can be array points, thus enabling you to add multiple records
in one operation.
Note:
When using a Field level connection, the operation may be cancelled at any stage
before the DBUpdate() function is called by calling the DBExecute() command
"CancelUpdate".
Note:
Only Fields with a property type of ‘Add’ can be added to a Recordset. The value(s) of
the associated points at the time DBUpdate() is called will be used to create the record.
Note:
Depending on the ADO provider, the added record may not be visible until the
Recordset is requeried. See DBExecute, parameter Requery for more information.
Содержание CX-SUPERVISOR - SCRIPT REFERENCE REV2.0
Страница 2: ...CX Supervisor Script Language Software Revision 2 0...
Страница 3: ......
Страница 5: ...CX Supervisor Script Language OMRON Page ii Revision 2 0...
Страница 7: ...CX Supervisor Script Language OMRON Page iv Revision 2 0...
Страница 9: ...CX Supervisor Script Language OMRON Page vi Revision 2 0...
Страница 13: ......
Страница 15: ...CHAPTER 1 Introduction OMRON Page 2 Revision 2 0...
Страница 19: ...CHAPTER 2 Expressions OMRON Page 6 Revision 2 0...
Страница 21: ...CHAPTER 3 Scripts OMRON Page 8 Revision 2 0...
Страница 151: ...CHAPTER 8 Colour Palette OMRON Page 138 Revision 2 0...